Input
A labeled field for a short typed value.
In Brand expressive
See it live
npm run storybookWhen to use it
In Brand expressive: The sign-up email.
- Use it when: A name, email, phone number or other one-line answer.
- Not when: Long text (textarea), or a closed choice (radio group, select or checkbox).
Instead:
How Brand expressive uses it
Words
- Headlines are short and bold. Three to six words.
- Verbs that move: Join, Try, Go.
- Playful in headlines, plain in errors.
- Use: Join, Drop, Go, Love. Avoid: Synergy, Leverage, Kindly.
The labels components use, from the voice tokens:
content.action.commit: Gocontent.action.cancel: Not nowcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Explore the drop
See Voice and tone for the whole voice.
Accessibility and keyboard
Test before you ship:
- A visible label, never a placeholder as the only label. undefined
Use it in code
npx open-ds add input
The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.
Tokens it reads
Input reads 17 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Input's tokens to change Input alone.
Brand expressive decides what changes when you switch theme. Here a switch changes colors only, so the marked rows differ between light and dark; everything else holds steady.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Input | ||
| Fill Changes with theme | component.input.backgroundcolor.surface.defaultvar(--input-background) | Lighttaupe.light.0:#FFFFFFDarktaupe.dark.50:#1F1411 |
| Text Changes with theme | component.input.textcolor.text.primaryvar(--input-text) | Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3 |
| Placeholder Changes with theme | component.input.placeholdercolor.text.mutedvar(--input-placeholder) | Lighttaupe.light.600:#6B544ADarktaupe.dark.400:#B5988A |
| Height | component.input.heightsize.control.defaultvar(--input-height) | size.52:3.25rem |
| Padding, left and right | component.input.padding-xspace.inset.control-xvar(--input-padding-x) | space.28:1.75rem |
| Corner | component.input.radiusradius.controlvar(--input-radius) | radius.999:9999px |
| Text size | component.input.font-sizetype.body.font-sizevar(--input-font-size) | font.size.17:1.0625rem |
| Font family | component.input.font-familytype.body.font-familyvar(--input-font-family) | font.family.dm-sans:"DM Sans", system-ui, sans-serif |
| Border width | component.input.border-widthborder-width.defaultvar(--input-border-width) | border-width.2:2px |
| Focus on focus | component.input.focusborder-width.focusvar(--input-focus) | border-width.3:3px |
| Canvas Changes with theme on focus | component.input.canvascolor.surface.canvasvar(--input-canvas) | Lighttaupe.light.50:#FFF8F3Darktaupe.dark.0:#120B09 |
| Danger Changes with theme when invalid | component.input.dangercolor.status.dangervar(--input-danger) | Lightred.light.600:#C42B2BDarkred.dark.600:#F28B8B |
| Border | ||
| Color Changes with theme | component.input.bordercolor.border.strongvar(--input-border) | Lighttaupe.light.500:#8A6F63Darktaupe.dark.400:#B5988A |
| Focus Changes with theme on focus | component.input.border.focuscolor.border.focusvar(--input-border-focus) | Lightpink.light.600:#D61F7ADarkpink.dark.600:#F59ACA |
| Disabled | ||
| Fill Changes with theme when disabled | component.input.disabled.backgroundcolor.disabled.surfacevar(--input-disabled-background) | Lighttaupe.light.100:#FCEFE6Darktaupe.dark.100:#33241F |
| Border Changes with theme when disabled | component.input.disabled.bordercolor.disabled.bordervar(--input-disabled-border) | Lighttaupe.light.200:#F2DCCFDarktaupe.dark.200:#4D3A33 |
| Text Changes with theme when disabled | component.input.disabled.textcolor.disabled.textvar(--input-disabled-text) | Lighttaupe.light.500:#8A6F63Darktaupe.dark.500:#E2C4B3 |