Input
Input is a basic form element for collecting text data from users. Supports various text input types including email, password, and search.
Playground
<Input placeholder="Type here..." />Variants
Sizes
xssmdefaultlgxl| Size | Height | H-Padding | Font | Icon | Usage | Preview |
|---|---|---|---|---|---|---|
xs | 36px | 12px | 13px | 14px | Compact | |
sm | 40px | 12px | 14px | 14px | Small | |
default | 44px | 16px | 16px | 16px | Standard (Recommended) | |
lg | 48px | 16px | 16px | 16px | Spacious | |
xl | 56px | 16px | 16px | 16px | Large |
Touch target: WCAG 2.5.8 requires a minimum 24px touch area. Even the smallest xs (36px) meets the WCAG standard.
iOS Safari: Font size 16px+ prevents auto-zoom on iOS Safari. Sizes default and above use 16px font and 16px icons.
Features
With Icons
<Input leftIcon={<Search />} placeholder="Search..." />
<Input rightIcon={<Mail />} placeholder="Email address" />
<Input leftIcon={<Lock />} rightIcon={<Eye />} type="password" placeholder="Password" />States
0/50
This field is required
Focus States
focusRing: false (default): Border change only on click, focus ring auto-shown on keyboard Tab. focusRing: true: Always show focus ring.
API
Props
variant"default""default" | "filled"Input visual style
size"default""xs" | "sm" | "default" | "lg" | "xl"Input height (36/40/44/48/56px) - Input-specific scale
radius"default""none" | "sm" | "base" | "default" | "lg" | "xl" | "2xl" | "3xl" | "full"Border radius size (6px)
leftIconundefinedReactNodeLeft icon
rightIconundefinedReactNodeRight icon
focusRingfalsebooleanShow custom focus ring. Keyboard-only focus ring shown even when false
errorundefinedbooleanError state (red border)
disabledundefinedbooleanDisabled state
placeholderundefinedstringPlaceholder text
typeundefinedstringInput type (text, email, password, etc.). HTML default: text
| Name | Type | Default | Description |
|---|---|---|---|
variant | "default" | "filled" | "default" | Input visual style |
size | "xs" | "sm" | "default" | "lg" | "xl" | "default" | Input height (36/40/44/48/56px) - Input-specific scale |
radius | "none" | "sm" | "base" | "default" | "lg" | "xl" | "2xl" | "3xl" | "full" | "default" | Border radius size (6px) |
leftIcon | ReactNode | undefined | Left icon |
rightIcon | ReactNode | undefined | Right icon |
focusRing | boolean | false | Show custom focus ring. Keyboard-only focus ring shown even when false |
error | boolean | undefined | Error state (red border) |
disabled | boolean | undefined | Disabled state |
placeholder | string | undefined | Placeholder text |
type | string | undefined | Input type (text, email, password, etc.). HTML default: text |
Field
errorfalsebooleanError state. Auto-propagates to Field.Error and Input
disabledfalsebooleanDisabled state. Auto-propagates to Field.Label and Input
gap"default""none" | "xs" | "sm" | "default" | "lg"Gap between child elements (0 / 4 / 6 / 8 / 12px)
| Name | Type | Default | Description |
|---|---|---|---|
error | boolean | false | Error state. Auto-propagates to Field.Error and Input |
disabled | boolean | false | Disabled state. Auto-propagates to Field.Label and Input |
gap | "none" | "xs" | "sm" | "default" | "lg" | "default" | Gap between child elements (0 / 4 / 6 / 8 / 12px) |
Field.Label
requiredfalsebooleanShow required mark (*) at end of label
| Name | Type | Default | Description |
|---|---|---|---|
required | boolean | false | Show required mark (*) at end of label |
Anatomy
Best Practices
Recommended
- ✓Always add a label (or aria-label)
- ✓Use appropriate input type (email, tel, etc.)
- ✓Show clear feedback on error
- ✓Ensure sufficient touch area (WCAG 2.5.8: 24px+)
Avoid
- ✗Don't use placeholder as a label substitute
- ✗Don't disable autocomplete unnecessarily
- ✗Ensure errors aren't indicated by color alone
- ✗Clearly state input restrictions upfront
Accessibility
Keyboard
WCAG 2.2 Compliance
- Focus indicator
- aria-invalid (on error)
- autocomplete support
- Contrast ratio 4.5:1 or higher