TextInput

Examples

Simple TextInput

Copied to clipboard

Disabled TextInput

Copied to clipboard

ReadOnly TextInput

Copied to clipboard

Invalid TextInput

Copied to clipboard

TextInput Props

The TextInput component accepts the following props.

NameTypeRequiredDefaultDescription
className
string
''Additional classes added to the TextInput.
isRequired
bool
falseFlag to show if the input is required.
type
enum: 'text', 'date', 'datetime-local', 'email', 'month', 'number', 'password', 'search', 'tel', 'time', 'url'
'text'Type that the input accepts.
value
string | number
nullValue of the input.
isValid
bool
trueFlag to show if the input is valid or invalid.
isDisabled
bool
falseFlag to show if the input is disabled.
onChange
func
() => undefinedA callback for when the input value changes.
isReadOnly
bool
falseFlag to show if the input is read only.
aria-label
custom
nullCustom flag to show that the input requires an associated id or aria-label.