Skip to main content

Input

A basic widget for getting the user input is a text field. Keyboard and mouse can be used for providing or changing data.

When To Use#

  • A user input in a form field is needed.
  • A search input is required.

Examples#

import { Input, Textarea, FormField } from 'tailor-ui';

Input#

Basic#

AutoSelect#

With FormField & Label#

With errors#

Something went wrong!

With disabled#

With size#

Prefix an Suffix#

Prefix
Suffix
https://.com
username:

focus and blur with ref#

Textarea#

Basic#

With rows & maxRows#

API#

Input#

PropertyDescriptionTypeDefault
autoSelectAuto select value of the input if trueboolean
sizeThe size of the input box'sm' 'md' 'lg''md'
prefixThe label text displayed before (on the right side of) the input field.ReactNode
suffixThe label text displayed after (on the right side of) the input field.ReactNode
idThe ID for inputstring
valueThe input content valuestring
defaultValueThe initial input contentstring
onChangecallback when user input(event: ChangeEvent) => void
onPressEnterThe callback function that is triggered when Enter key is pressed(event: KeyboardEvent) => void
disabledWhether the input is disabled.booleanfalse

Textarea#

PropertyDescriptionTypeDefault
onResizeCalled whenever the textarea resizes(event: Event) => void
rowsMinimum number of visible rowsnumber
maxRowsMaximum number of visible rowsnumber
valueThe input content valuestring
defaultValueThe initial input contentstring
onChangecallback when user input(event: ChangeEvent) => void