Input

Wrapper around <TextInput /> of react-native

import { Input, Icon } from "react-native-magnus";

<Input
  placeholder="Username"
  p={10}
  focusBorderColor="blue700"
  suffix={<Icon name="search" color="gray900" fontFamily="Feather" />}
/>;

Examples

Password Entry

As <Input> accepts every prop of <TextInput>, We can set input for password with secureTextEntry prop.


<Input
  placeholder="Password"
  mt="md"
  p={10}
  secureTextEntry
  focusBorderColor="blue700"
/>

Props

PropertyDescriptionTypeDefault
mmargin`stringnumber`
mtmargin top`stringnumber`
mrmargin right`stringnumber`
mbmargin bottom`stringnumber`
mlmargin margin left`stringnumber`
mxmargin horizonal`stringnumber`
mymargin vertical`stringnumber`
ppadding`stringnumber`
ptpadding top`stringnumber`
prpadding right`stringnumber`
pbpadding bottom`stringnumber`
plpadding margin left`stringnumber`
pxpadding horizonal`stringnumber`
pypadding vertical`stringnumber`
hheightnumber-
wwidthnumber-
bgbackground colorstring-
minHmininmum heightnumber-
minWminimum widthstring-
roundedborder radius`stringnumber`
roundedTopborder radius top`stringnumber`
roundedBottomborder radius bottom`stringnumber`
roundedLeftborder radius left`stringnumber`
roundedRightborder radius right`stringnumber`
borderColorcolor for borderstring-
borderTopColorcolor for border topstring-
borderRightColorcolor for border rightstring-
borderLeftColorcolor for border leftstring-
borderBottomColorcolor for border bottomstring-
borderWidthwidth for bordernumber-
borderTopWidthwidth for border topnumber-
borderRightWidthwidth for border rightnumber-
borderLeftWidthwidth for border leftnumber-
borderBottomWidthwidth for border bottomnumber-
shadowdescribe the depth of shadow to be usednumber-
shadowColorcolor for shadowstring-
colorcolor for input textstring-
loadingloading state for input. Shows ActivityIndicator when truebooleanfalse
loaderSizesize for loader component`stringnumber`
loaderColorcolor for loader componentstringgray300
focusBorderColorborder color when input is focussedstring-
suffixrenders a components at the end of input containerReact.ReactNode-
prefixrenders a components at the beginning of input containerReact.ReactNode-