Forms
Input
A pill-shaped text field. Use it inside FormField.
import { FormField, Input } from "@somewhere-com/ds";
<FormField label="Email">
<Input type="email" placeholder="you@company.com" />
</FormField>;
Props
- It takes every native
<input>attribute.typedefaults to"text", andrefis forwarded. - Inside a FormField, it gets
id,aria-describedby, andaria-invalidautomatically.
States
- Default: a soft border.
- Placeholder:
color.text.placeholder. - Focus: a 2px
color.focus-ringoutline. - There’s no disabled or invalid styling yet. A disabled input shows the browser default, and FormField’s error message shows an invalid one. Both are open design decisions.
Always label it, either with a FormField, <label for>, or aria-label. A placeholder is not a label.
Choose the right type (email, tel, url) so mobile keyboards match the input.
Examples
To change props and see every state live, open Input in Storybook.