Input

Retrieve text input from a user.

The Input contain an additional Hooks, see subsection useInput for details.

General

Basic input field.

Preview
See code

Sizes

Inputs of different sizes.

Preview
See code

Set width

Specify width or other styles.

Preview
See code

Unwritable

Disable interactive inputs.

Preview
See code

Inline Label

Show a short label in the line.

Preview
See code
username
.com

Block Label

Labels for custom styles.

Preview
See code

Type

Differentiate states by color.

Preview
See code

Rounded

You can completely round the corners of any type of Input with the rounded property.

Preview
See code

Icon

Specify an icon component.

Preview
See code

Clearable

Add a clear button in the input box.

Preview
See code

Password

Input component with a show/hide password functionality, Important: You have to use the Input.Password component.

Preview
See code

Get Change

Capture changes in input.

Preview
See code

Imperative API

Update component in an uncontrolled way.

Preview
See code

APIs

Input.Props

AttributeDescriptionTypeAccepted valuesDefault
valueinput valuestring--
initialValueinitial valuestring--
placeholderplaceholderstring--
typecurrent typeInputTypesInputTypesdefault
htmlTypenative type attrstring-text
readOnlynative attrboolean-false
disableddisable inputboolean-false
clearableshow clear iconboolean-false
labeltext label for inputstring--
labelRighttext label at right for inputstring--
iconicon for inputReact.ReactNode--
iconRighticon at right for inputReact.ReactNode--
iconClickableicons are clickableboolean-false
onIconClickclick icon event(e: React.ChangeEvent) => void--
onChangechange event(e: React.ChangeEvent) => void--
onClearClickclear icon event(e: React.MouseEvent) => void--
refforwardRefRef<HTMLInputElement | null>--
...native propsInputHTMLAttributes'alt', 'type', 'className', ...-

Input.Password.Props

AttributeDescriptionTypeAccepted valuesDefault
hideTogglehide toggle iconboolean-false
...input propsInput.PropsInput.Props-

InputTypes

type InputTypes =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'warning'
  | 'error'
  | 'info'

useInput

type useInput = (initialValue: string) => {
  state: string
  setState: Dispatch<SetStateAction<string>>
  currentRef: MutableRefObject<string>
  reset: () => void
  bindings: {
    value: string
    onChange: (event: React.ChangeEvent<HTMLInputElement>) => void
  }
}
Edit this page on GitHub

Previous

Image

Next

Keyboard

MADE & DESIGNED WITHBY BRUNO ANDRADE
docs background gradient blue
docs background gradient violet