Forms
A form asks for as little as it can and shows each problem exactly where it is.
Rules
A form asks for as little as it can, says what every field is, and shows a problem exactly where it is.
- Labels sit above fields. A placeholder is an example value, never the label: it disappears as soon as the person types.
- At most five fields in view. A longer form is split into sections or steps.
- Borders:
border-fieldat rest,brand-primaryon focus, on a surface fill. A field is a control whose border is its only boundary, so it holds WCAG 1.4.11 (3:1) against the ground and its own surface in both themes:border-fieldmeasures 3.81 / 4.83 light and 4.12 / 3.54 dark, whereborder-interactiveis 2.02:1 on the light ground. Brand ink straight on the ground isbrand-text-ground(5.28:1 light, 7.83:1 dark); brand primary itself is 4.18:1 there. - Errors belong to the field: the
errorcolor on its border and a message directly below it that says how to fix it, never only a message at the top of the page. - Errors appear when the person leaves a field or submits, not while they are still typing the first characters.
- The right input type and autofill hint (email, phone, one-time code, new password) so the keyboard and password managers help.
- The submit button names the action ("Save profile", "Send code") and shows progress while it runs; see Buttons.