TextInput
A general purpose text input field that is used with controlled state manangement.
Props
Name | Type | Default | Description |
|---|---|---|---|
onChange* | func | The change event handler. | |
name* | string | A unique semantic name that is connected to the label. | |
autoFocus | bool | The input will have focus when page has finished loading. Use with caution because autoFocus scrolls to the element if not in sight. It can confuse screen readers | |
description | string | Additional description information display beneath the input. | |
disabled | bool | Sets disabled. | |
errorMessage | string | An error message text that is displayed once isValid is false. | |
inputMode | text | decimal | numeric | tel | search | email | url | The inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard. | |
inputRef | func, shape | ||
isEmpty | func | A function that takes the value and returns a boolean that indicates an empty state | |
isValid | bool | Sets the validation state. | |
label | string | The label text. | |
loading | bool | Whether the input is loading | |
mode | compact | ||
onBlur | func | The bur event handler. | |
onClear | func | A function that is called when clicking the clear button that appears upon passing a value | |
onFocus | func | The focus event handler. | |
placeholder | string | The input placeholder | |
required | bool | Sets required. | |
suffix | string | Text suffix at the end of the input | |
type | text | number | tel | search | email | password | date | datetime-local | week | text | The input type. |
value | string, number | The controlled value. |
Examples
Default
Number
There are no native html arrows and it blurs when it's focused and user scrolls