Input
A versatile text input component with support for labels, validation states, icons, and various visual styles.
Import
Usage
Examples
Variant
Color.
Size
Radius
Status states
Invalid input
Valid input
Please review
With label
Label alignment
With description
We'll never share your email
With icons
Required
Disabled
Loading state
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | "md"* | Size scale |
radius | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | "md"* | Corner rounding |
variant | "solid" | "ghost" | "bordered" | "faded" | "underlined" | "bordered"* | Visual style of the input |
color | "none" | "default" | "primary" | "secondary" | "danger" | "warning" | "success" | "primary"* | Semantic color |
status | "default" | "error" | "success" | "warning" | "default" | Validation status |
label | string | None | Field label |
labelAlign | "left" | "top" | "left"* | Label position |
description | string | None | Help text below the field |
message | string | None | Status message (error/success/warning) |
required | boolean | false | Shows required indicator |
isLoading | boolean | false | Shows loading state |
disabled | boolean | false | Disables interaction |
startContent | ReactNode | None | Content displayed at the start of the input |
endContent | ReactNode | None | Content displayed at the end of the input |
className | string | None | Extra classes, merged with internal styles |
* Falls back through Global Configuration if not set. See below.
Global Configuration
Input reads defaults from four places, in this order of precedence:
- Instance prop: set directly on
<Input /> - Component config:
components.inputin yourashee.config - Theme default:
defaultVariant/defaultColor/defaultRadiusin yourashee.config - Built-in fallback: component's internal default values
Component config
Built-in fallbacks
Accessibility
- Renders a native
<input>element with proper semantics - Uses
aria-invalidfor error states - Uses
aria-describedbyto associate description and message text - Uses
aria-busyfor loading state - Supports
disabledandrequiredattributes natively - Implements
focus-visiblerings for keyboard navigation - Labels are properly associated with
htmlFor/id
Notes
- Status Colors: When
statusis set toerror,success, orwarning, the input border automatically reflects the status color. - Underlined Variant: When
variant="underlined", the input has no border radius and only a bottom border. - Icons: Use
startContentandendContentto add icons or other elements inside the input. - Loading State: When
isLoadingistrue, the input shows a loading indicator and disables interaction. - Virtual Keyboard: The Input component automatically integrates with the Keyboard system. See the Keyboard documentation for more details.
- Inheritance: Many other components (Select, Autocomplete, MultiSelect, DatePicker) extend the Input component and inherit all of its properties including label, description, status, and content slots.