Input

Input component specifies an field where the user can enter data.

Basic

The most basic usage of Input.

Sizes

There's three sizes of option for Input field.

Disabled

Disabled Input.

Affix

Input can have suffix or prefix content inside.

Password Visible

Example of controlling the Input type via prefix icon.

Textarea

Turn Input field to textarea by setting textarea prop to true.

Invalid

Display Input as invalid status when invalid prop is set to true.

Controlled Input

Controlled Input example.

API

Input
PropDescriptionTypeDefault
disabledWhether the Input is disabledboolean-
invalidWhether the Input is invalid statusboolean-
onBlurCallback when Input remove focus(e: MouseEvent) => void-
onChangeCallback when Input value changed(e: MouseEvent) => void-
onFocusCallback when Input is focused(e: MouseEvent) => void-
prefixRender a prefix content inside Inputstring | ReactNode-
sizeInput size'lg' | 'md' | 'sm''md'
suffixRender a suffix content inside Inputstring | ReactNode-
textAreaWhether to turn Input into textarea fieldboolean-
typeInput type, refer to MDN for available typesstring'text'
unstyleWhether to remove input default stylebooleanfalse