Skip to main content

TextInput

Usage

Name
function TextInputUsage() {
return (
<View>
<TextInput label="Name" placeholder="Enter name" />
</View>
)
}

Size

Name
Name
Name
function TextInputSizes() {
return (
<View>
<TextInput label="Name" placeholder="Enter name" size="small" />
<TextInput label="Name" placeholder="Enter name" size="medium" />
<TextInput label="Name" placeholder="Enter name" size="large" />
</View>
)
}

Modes

Flat Input
Outlined Input
function TextInputModes() {
return (
<View>
<TextInput label="Flat Input" placeholder="Placeholder" mode="flat" />
<TextInput
label="Outlined Input"
placeholder="Placeholder"
mode="outlined"
/>
</View>
)
}

Dense

Label
Label
function TextInputDense() {
return (
<View>
<TextInput label="Label" placeholder="Placeholder" mode="flat" dense />
<TextInput label="Label" placeholder="Placeholder" dense />
</View>
)
}

Disabled

Address
function TextInputDisabled() {
return (
<View>
<TextInput label="Address" placeholder="Address" value="Home" disabled />
</View>
)
}

Error

Password
Please enter a password of min. length 8
function TextInputError() {
const [password, setPassword] = useState('')

return (
<View>
<TextInput
label="Password"
placeholder="Enter Password"
secureTextEntry
value={password}
onChangeText={setPassword}
error={
password.length > 5 ? '' : 'Please enter a password of min. length 8'
}
/>
</View>
)
}

Status

Label
Label
Label
Label
Label
Label
function TextInputStatuses() {
return (
<View>
<TextInput status="primary" label="Label" placeholder="Placeholder" />
<TextInput status="accent" label="Label" placeholder="Placeholder" />
<TextInput status="success" label="Label" placeholder="Placeholder" />
<TextInput status="info" label="Label" placeholder="Placeholder" />
<TextInput status="warning" label="Label" placeholder="Placeholder" />
<TextInput status="error" label="Label" placeholder="Placeholder" />
</View>
)
}

Props

PropData TypeDefault ValueDescription
ExtendsOmit<TextInputProps$1, 'style'>--Inherits properties from Omit<TextInputProps$1, 'style'>
mode"outlined" | "flat"outlinedControl the different modes of the text input
denseboolean--Have a denser background in the text input
labelstring--Label text above the input
placeholderstring--Placeholder for the text input
captionstring--Caption text below the text input
errorstring--Error text in error status below caption text
labelStyleStyleProp<TextStyle>--Label text style
placeholderStyleStyleProp<TextStyle>--Placeholder text style
captionStyleStyleProp<TextStyle>--Caption text style
errorStyleStyleProp<TextStyle>--Error text style
containerStyleStyleProp<ViewStyle>--Container view style
inputStyleStyleProp<ViewStyle>--Input box style
textStyleStyleProp<TextStyle>--Input text style equivalent to react-native style for TextInput
disabledboolean--Set to true to disable the button
leftReactNode--Render Icon/JSX on the left of the button
rightReactNode--Render Icon/JSX on the right of the button
statusBlossomStatusprimary--
sizeBlossomSizemedium--