Forms · SU-148 · SU-151 · SU-152
Errors are text next to the field, linked to it
Flip between the version shibroUI flags and the one it ships. The marks and callouts show what changes.
-
Label, gone once typed
placeholder only
-
Field
label above · aria-invalid
Create your account
Create your account
-
Error message
“Invalid input” in a toast
-
Error: what + how to fix
describedby="email-error"
What changes
- Bad
- The only label is a placeholder that vanishes once typed, and the error is a vague “Invalid input” toast away from the field.
audit.js: SU-148 fail: field named only by its placeholder · SU-151 fail: field is marked aria-invalid but no visible error text is linked to it - Good
- A visible label, a hint, and an error that says what to type, sitting beside the field and tied to it with
aria-describedby.
The rules
-
SU-148
Every field has a visible, persistent label. A label sits above each field. Hints and format examples sit between the label and the field, linked with
aria-describedby. The placeholder holds an example at most, never the label. -
SU-151
Inline errors are text, next to the field, and linked. The message sits between the label and the field, or directly under the field. It uses an icon plus text in the danger color (≥ 4.5:1). The field gets a 2px danger border (≥ 3:1),
aria-invalid="true"andaria-describedbypointing at the message. The message says what's wrong and how to fix it (SU-180). -
SU-152
An error summary on submit. On a multi-field form, any error on submit shows a summary above the form ("There is a problem", or Polaris-style "To save this product, make 2 changes"). It lists each error as a link to its field, in the same words as the inline message. Focus moves to it, and the page title gets an "Error: " prefix. A single-field form just focuses the field.