Input
Single-line text entry with leading and trailing slots, three sizes and a shared control surface used by every other text control.
Live preview
Source
The exact file rendered in the preview above.
components/demos/input.tsx
components/ui/input.tsx
components/ui/field.tsx
Demo source — adapt to your project. Foundry is not published as a package.
Usage
The workhorse of the form system. Its border, radius, height and invalid treatment are exported as `controlSurface` and reused by Select, Textarea, SearchField, DateField and Combobox, so the whole family stays visually identical.
- Set `type` and `inputMode` deliberately — `inputMode="decimal"` on a price field is the difference between a usable and an unusable mobile form.
- Adornments are decorative. Anything a user must read belongs in the label or help text.
- Read-only differs from disabled: read-only values are still focusable, copyable and submitted.
Variants and states
Every entry below is a genuine difference in behaviour or layout, and every one of them is visible in the preview above.
- Plain text entry
- Leading icon — for email, search and identifiers
- Trailing adornment — units, currency suffixes
- Read-only — value matters but cannot change here
- Disabled — unavailable in this context
- Invalid — bordered and tinted, wired by Field
- Small, medium and large heights
Accessibility
- Naming
- Inputs are never labelled by placeholder text — a placeholder disappears the moment typing begins.
- Autofill
- Set `autoComplete` on identity fields so password managers and browser autofill work.
- Invalid
- `aria-invalid` is applied by Field; the styling hangs off the attribute rather than a class, so the two can never disagree.
Foundry implements published ARIA patterns and is tested against them. No WCAG certification is claimed — see the accessibility documentation for what is and is not covered.
Related
All componentsField
The accessibility contract shared by every form control — label, help text, error, success and the ARIA wiring that connects them.
intermediateFeatured7 variantsTextarea
Multi-line entry on the shared control surface, with a resize affordance that respects the layout.
starter4 variantsSearch field
A search input with a keyboard-reachable clear button and an optional shortcut hint.
starter4 variantsCombobox
A filterable single-select implementing the ARIA 1.2 combobox pattern, with active-descendant browsing that never moves focus out of the input.
advancedFeatured5 variants