Text Input
Single-line text input with optional label, error, and hint. Supports all native input props (placeholder, disabled, etc.).
Installation
tsx
import { TextInput } from "@workspace/ui/components/text-input"Basic usage
tsx
<TextInput
label="Email"
placeholder="you@example.com"
/>With error and hint
tsx
<TextInput
label="Username"
placeholder="johndoe"
error="Username is already taken"
hint="Choose a unique username"
/>Username is already taken
Sizes
tsx
<TextInput label="Small" size="sm" placeholder="Small" />
<TextInput label="Default" size="default" placeholder="Default" />
<TextInput label="Large" size="lg" placeholder="Large" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | Label above the input. |
| error | string | - | Error message shown below the input. |
| hint | string | - | Hint text below the input. |
| size | "default" | "sm" | "lg" | "default" | Input size. |
| containerClassName | string | - | Classes for the wrapper. |
| inputClassName | string | - | Classes for the input element. |