Input
Simple standalone input field. When inside a Field, inherits its invalid
state (setting aria-invalid) unless hasError is passed explicitly.
For inputs with icons, addons, or buttons, use InputGroup.
Usage
@desk/ui/components/input
<Stack className="w-80" gap="lg">
<Field>
<FieldLabel htmlFor="material-name">Material name</FieldLabel>
<FieldContent>
<Input
defaultValue="Calacatta Gold marble"
id="material-name"
placeholder="e.g. Reclaimed oak"
/>
<FieldDescription>Shown across the catalogue.</FieldDescription>
</FieldContent>
</Field>
<Field>
<FieldLabel htmlFor="material-price">List price</FieldLabel>
<FieldContent>
<InputGroup>
<InputGroupAddon variant="muted">$</InputGroupAddon>
<InputGroupInput defaultValue="148.00" id="material-price" />
<InputGroupAddon align="inline-end" variant="muted">
per m²
</InputGroupAddon>
</InputGroup>
</FieldContent>
</Field>
</Stack>Best practices
For icons, addons, prefixes, or trailing buttons use
InputGroup, notInputplus manually absolute-positioned decorations.Inside a
Field, let invalid state cascade — omithasError; passhasErroronly to force error styling on a standaloneInput.Give every
Inputan associatedLabel(viaField/FieldLabelorhtmlFor); a placeholder is not an accessible name.sizedefaults to"xl"(48px); pass a responsive object like{ base: "sm", md: "xl" }rather than swapping components per breakpoint.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| testId | string | ||
| radius | "rounded" | "square" | "full" | null | undefined | ||
| size | ResponsiveSize | "xl" (48px) | Field size — a single token or a per-breakpoint object like
|
| hasError | boolean | Force error styling; overrides invalid state inherited from an ancestor Field. | |
| focused | boolean | Force focus ring display (for documentation/testing) |
Also exports
- type
InputProps - type
InputSize - const
standaloneInputVariants
Composition
Builds on
Used by