Input
Displays a form input field or a component that looks like an input field.
Powered by
Installation
npx shadcn@latest add @redpanda/inputpnpm dlx shadcn@latest add @redpanda/inputyarn dlx shadcn@latest add @redpanda/inputbunx shadcn@latest add @redpanda/inputnubx shadcn@latest add @redpanda/inputaube dlx shadcn@latest add @redpanda/inputWhen to use
Use this decision tree to determine when to use the Input component:
Usage
import { Input } from '@/components/ui/input';<Input />Appearance contracts
Use finite props for appearance; reserve className for placement and width.
| Prop | Values | Purpose |
|---|---|---|
size |
sm, md, lg |
Consistent field height and padding |
tone |
standard, success |
Verified-value feedback; aria-invalid still takes precedence |
textStyle |
standard, monospace |
Fixed-width identifiers, durations, and large integers |
appearance |
standard, surface, flat, surface-flat, embedded, inline |
Field chrome owned by the input |
surface uses the page background; flat removes the field shadow. surface-flat combines these for sidebar search. Use embedded only inside a composite that already provides its border and focus indicator, such as InputGroup. Use inline for editable text that inherits its surrounding typography and owns an underline instead of a boxed field.
Supply aria-invalid or a Field error state for invalid values rather than replacing border classes. Put icons and interactive controls in InputStart and InputEnd; their measured widths reserve text space without manual padding overrides.
Color swatches
Use ColorInput for a native color picker rather than restyling the text Input. Its presentation="swatch" mode sits over a painted proxy and reveals the native control with a visible ring on keyboard focus. Always provide a label; the forwarded ref points directly to the native color input.
import { ColorInput } from '@/components/ui/input';
<ColorInput aria-label="Accent color" defaultValue="#c93617" />;Examples
Default
Number
Password
File
Disabled
With Label
With Button
With Slots
With Date Picker
Form
Credits
- We take our inspiration from Shadcn UI for the input component and style.