Behaviour rules and guidelines
79 rules and 23 guidelines. A rule is decided by WCAG 2.2 or by the judges. A guideline is our own choice, where the judges are split or too few have spoken. How the method works
New to the rules? Start with what shadcn and Radix handle and what they leave to you, or read why AI coding agents need rules like these.
Actions
11 rules and 4 guidelines. Accessible button patterns for shadcn: what the area covers and how its rules fit together.
Colour and motion
11 rules and 0 guidelines. Colour contrast and motion patterns for shadcn: what the area covers and how its rules fit together.
Destructive actions
2 rules and 0 guidelines. Delete confirmation and undo patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
DST-001a Make destructive actions reversible, and offer Undo instead of asking first | Rule | Unanimous (2 of 2) | decided |
DST-001b Ask before an action only when it cannot be reversed or a mistake would cost a lot | Rule | Unanimous (3 of 3) | decided |
Dialogs
5 rules and 2 guidelines. Accessible dialog patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
DLG-001 Let Escape do what Cancel does in a dialog | Rule | Unanimous (3 of 3) | decided |
DLG-002 Keep one dialog open at a time | Rule | Unanimous (2 of 2) | decided |
DLG-003 Name the action on the destructive button and always offer Cancel | Rule | Unanimous (3 of 3) | decided |
DLG-004 Never make the destructive button the default in a confirmation dialog | Guideline, our choice | Split (1 of 2) | decided |
DLG-005 Give the destructive button the danger style, also when the person asked for the action | Guideline, our choice | Split (1 of 2) | decided |
DLG-006 Move focus into a modal dialog when it opens and back to its opener when it closes | Rule | Requirement | proposed |
DLG-007 Keep Tab inside a modal dialog and the page behind it out of use | Rule | Unanimous (2 of 2) | proposed |
Feedback
4 rules and 0 guidelines. Toast and status message patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
FBK-002 Show a failed action where it started and keep it there | Rule | Unanimous (3 of 3) | decided |
FBK-003 Show a successful result in the view, not only in a toast that disappears | Rule | Unanimous (3 of 3) | decided |
FBK-004 Announce a status message without moving focus | Rule | Requirement | decided |
FBK-005 Give a toast at most one action, keep it until it is used, and offer that action elsewhere too | Rule | Unanimous (2 of 2) | decided |
Forms
15 rules and 12 guidelines. Accessible form patterns for shadcn: what the area covers and how its rules fit together.
Keyboard
5 rules and 0 guidelines. Keyboard and focus patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
KBD-001 Let the keyboard do everything the pointer can, and show where focus is | Rule | Requirement | decided |
KBD-002 Keep the focused element at least partly in view | Rule | Requirement | decided |
KBD-003 Let people turn off or change a shortcut made only of character keys | Rule | Requirement | proposed |
KBD-003a Show every shortcut the product adds, beside its command or in one list | Rule | Unanimous (2 of 2) | proposed |
KBD-003b Build a shortcut on a modifier key by default | Rule | Unanimous (2 of 2) | proposed |
Layout
4 rules and 0 guidelines. Responsive layout and reading order for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
LAY-001 Let the page fit a 320-pixel viewport without scrolling sideways | Rule | Requirement | decided |
LAY-002 Keep the order in the code telling the same story as the order on screen | Rule | Requirement | decided |
LAY-003a Let text grow to 200 percent without losing content or function | Rule | Requirement | proposed |
LAY-003b Keep all text and functions intact when people widen the text spacing | Rule | Requirement | proposed |
Navigation
3 rules and 1 guideline. Navigation menu patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
NAV-002a When a menu shows the current page, say so in the code on that item | Rule | Requirement | proposed |
NAV-002b Mark the current page in a repeated menu with a cue that is not colour alone | Rule | Unanimous (2 of 2) | proposed |
NAV-003 Keep repeated navigation in the same order on every page | Rule | Requirement | proposed |
NAV-004 Start a page with a skip link when links come before its main content | Guideline, our choice | Insufficient evidence (1 of 3 judges spoke) | proposed |
Page structure
7 rules and 1 guideline. Page structure patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
STR-001 Give every page a title that says what it is for, and change it with every view | Rule | Requirement | proposed |
STR-002a Mark text that heads a part of the view as a heading in code | Rule | Requirement | proposed |
STR-002b Word each heading so it says what the part below it holds | Rule | Requirement | proposed |
STR-003 Give each view one h1 and every other heading the level its place in the outline gives it | Guideline, our choice | Insufficient evidence (1 of 3 judges spoke) | proposed |
STR-004 Build the page's regions from landmark elements, and name repeated ones apart | Rule | Unanimous (2 of 2) | proposed |
STR-005 Give images and icons that carry information a text alternative, and hide the ones that only decorate | Rule | Requirement | proposed |
STR-006 Name the page's main language in the lang attribute on the html element, and change it when the interface changes language | Rule | Requirement | proposed |
STR-006a Mark text in another language than the text around it with its own lang attribute | Rule | Requirement | proposed |
States
5 rules and 2 guidelines. Loading and empty state patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
STA-001 Show a wait in the part that is loading, not over the whole page | Rule | Unanimous (3 of 3) | decided |
STA-002a Say what will appear in a space that holds nothing yet, and offer the first step | Rule | Unanimous (2 of 2) | proposed |
STA-002b Never say a space is empty while its content is still loading | Rule | Unanimous (2 of 2) | proposed |
STA-003 When a search or filter matches nothing, say so and offer a way to change it | Guideline, our choice | Insufficient evidence (1 of 3 judges spoke) | proposed |
STA-004 Let people turn off, lengthen or extend a time limit the product sets | Rule | Requirement | decided |
STA-005a Show that a sent action is under way until the reply comes | Rule | Unanimous (3 of 3) | proposed |
STA-005b While an action is being sent, a second press does not send it again | Guideline, our choice | Insufficient evidence (1 of 3 judges spoke) | proposed |
Tables
3 rules and 1 guideline. Accessible data table patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
TBL-001 Build data in rows and columns as a table in code, with its headings marked as headers | Rule | Requirement | proposed |
TBL-002 Put a keyboard sort control in a sortable header, and expose its order in code | Rule | Requirement | proposed |
TBL-003 Give every row action its own control the keyboard reaches, and show hidden actions on focus | Rule | Requirement | proposed |
TBL-004 Give every data table a visible title and tie it to the table in code | Guideline, our choice | Insufficient evidence (1 of 3 judges spoke) | proposed |
Text
4 rules and 0 guidelines. Error, tooltip and link text patterns for shadcn: what the area covers and how its rules fit together.
| Rule | Level | Verdict | Status |
|---|---|---|---|
TXT-001a Say what went wrong, what it concerns and what to do next | Rule | Unanimous (3 of 3) | decided |
TXT-002a Let people close, hover and keep content that appears on hover or focus | Rule | Requirement | decided |
TXT-002b Open tooltips on focus too, and keep what people need on the page | Rule | Unanimous (2 of 2) | decided |
TXT-003 Make every link's destination clear from its text, its name or the sentence it sits in | Rule | Requirement | decided |
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.