Stable
Text inputs let managers type and edit a single line of text: a name, a reference, an amount. Every input has a visible label above it, and optional help text between the label and the field.
Specifications
Anatomy
In pounds, before VAT.
Anatomy
In pounds, before VAT.
Size and spacing
Text input
Use the right type so phones show the right keyboard: text, email, tel, or inputmode="decimal" for money.
Example
States
Default
Hover
Focus
Error
Disabled
Example
States
Default
Hover
Focus
Error
Disabled
Usage
When to use
- Short free text: names, references, amounts, email addresses.
When not to use
- Long text: use a textarea.
- A fixed set of answers: use radios or a select.
Content
- Labels are short nouns: "Reference", not "Please enter your reference".
- Put format help in the hint: "In pounds, before VAT".
- Do not use placeholder text: it disappears when typing and has poor contrast.
Do and don't
In pounds, before VAT.
Do
- Always show a label above the input.
- Set type="email", "number" or "tel" where it fits.
Don't
- Use placeholder text as the label.
Implementation
HTML
<div class="at-field">
<label class="at-label" for="ref">Reference</label>
<input class="at-input" id="ref" type="text" />
</div>Classes
| Class | What it does |
|---|---|
at-field | Wraps label, input, hint and error |
at-input | The input |
Tokens used
--at-border, --at-surface, --at-text, --at-border-bold
Accessibility
- Link label and input with for / id.