TextInput
A labeled <input> element with optional description, error message, and asterisk indicator. Supports all standard HTML input types via the type prop.
Default
<TextInput label="Your name" placeholder="Enter your name" />With description and error
We'll never share your email.
Username is already taken.
<TextInput
label="Email"
description="We'll never share your email."
placeholder="your@email.com"
type="email"
/>
<TextInput
label="Username"
withAsterisk
error="Username is already taken."
/>Input types
<TextInput label="Email" type="email" placeholder="email@example.com" />
<TextInput label="Password" type="password" />
<TextInput label="Number" type="number" />Sizes
<TextInput size="xs" label="xs" />
<TextInput size="sm" label="sm" />
<TextInput size="md" label="md" />
<TextInput size="lg" label="lg" />
<TextInput size="xl" label="xl" />Disabled
<TextInput label="Disabled" disabled value="Cannot be changed" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | — | Associates label with input via HTML for/id |
label | ReactNode | — | Label rendered above the input |
description | ReactNode | — | Helper text below the label |
error | ReactNode|boolean | — | Error message; pass true for styles only |
required | boolean | — | Marks as required and adds asterisk |
withAsterisk | boolean | — | Adds asterisk without native required attribute |
disabled | boolean | — | Disables the input |
size | 'xs'|'sm'|'md'|'lg'|'xl' | — | Font size and height via design tokens |
radius | 'xs'|'sm'|'md'|'lg'|'xl'|string | — | Border-radius of the input |
type | string | 'text' | HTML input type attribute |
placeholder | string | — | Placeholder text |
value | string | — | Pre-fills the input (uncontrolled SSR) |
name | string | — | Form field name |
class | string | — | Additional CSS class names |
style | object | — | Inline styles |