Usage
Props
Controlled value of the input.
Default value for uncontrolled mode.
Called when the input value changes. Receives the string value directly (not the DOM event).
Placeholder text displayed when input is empty.
HTML input type attribute (e.g., ‘text’, ‘email’, ‘password’, ‘number’).
Disables the input and prevents user interaction.
Makes the input read-only (value visible but not editable).
Error message to display below the input. When set, applies error styling.
Label text displayed above the input.
Size variant:
sm: h-7, px-2.5, text-xsmd: h-9, px-3, text-smlg: h-11, px-4, text-base
Additional CSS classes to apply to the input element.
HTML ID attribute. Auto-generated if not provided.
Examples
Basic Input
With Error State
Different Sizes
Controlled Search Input
Disabled and Read-Only
Notes
- The
onChangecallback receives the string value directly, not the DOM event - Focus states include a ring effect for accessibility
- Error state changes border color and displays error message below
- Auto-generates ID for label association if not provided
- Supports all standard HTML input attributes via forwarded ref