TextField
Text fields let users enter and edit text.
When to use#
When a maxLength and label needs to be provided.
Examples#
Basic#
With maxLength#
12
With textarea#
With textarea & maxLength#
100
With textarea & error#
With maxLength & error#
12
With empty label#
30
With controlled value switch#
18
API#
| Property | Description | Type | Default |
|---|---|---|---|
label | The label text | string | |
value | value of the TextField | string | |
defaultValue | defaultValue of the TextField | string | |
maxLength | The content max length of textfield | number | |
textarea | Whether the input is a textarea | boolean | false |
disabled | Disabled the TextField | boolean | false |
If you are using textarea props, you can consult Input's documentation to find more
textarea APIs.