# Justified by Blackwood & Blake > Behaviour rules and components for shadcn apps, tried against WCAG 2.2 and written so AI coding agents can build by them. It helps teams work toward WCAG 2.2 AA; it is not a certification. The whole site as one text file: https://blackwoodblake.com/design-system/llms-full.txt. Every rule as JSON: https://blackwoodblake.com/design-system/patterns/rules.json. On npm: @blackwoodblake/justified-tokens (the theme as CSS custom properties), @blackwoodblake/justified-patterns (every rule as data) and @blackwoodblake/justified-agents (the skills and AGENTS.md as files). The components are added with the shadcn CLI, not from npm. ## Start here - [Why Justified](https://blackwoodblake.com/design-system/why/): the problem it solves for shadcn apps - [Is shadcn accessible?](https://blackwoodblake.com/design-system/accessible-shadcn/): what shadcn's Radix primitives handle, and the behaviour decisions they leave to your app - [Design system rules for AI coding agents](https://blackwoodblake.com/design-system/ai-coding-agents/): why agents need explicit behaviour rules, and what makes a rule usable by one - [Design system vs component library](https://blackwoodblake.com/design-system/articles/design-system-vs-component-library/): what each is, and whether shadcn is a design system ## Get started - [Overview](https://blackwoodblake.com/design-system/get-started/): what Justified gives a shadcn app - [Use with shadcn](https://blackwoodblake.com/design-system/get-started/shadcn/): add the theme and components with the shadcn CLI - [Use with an AI agent](https://blackwoodblake.com/design-system/get-started/ai-agents/): give Claude Code or another agent the rules - [Change the theme](https://blackwoodblake.com/design-system/get-started/theming/): own colours, kept readable ## For agents - [SKILL.md](https://blackwoodblake.com/design-system/agents/skills/justified/SKILL.md): every rule in one short statement, as a Claude Code skill - [Review skill](https://blackwoodblake.com/design-system/agents/skills/justified-review/SKILL.md): reviews code against every rule and reports by file, line and rule id, with [checks.md](https://blackwoodblake.com/design-system/agents/skills/justified-review/checks.md), what to look for in code for each rule - [justified-skill.tar.gz](https://blackwoodblake.com/design-system/agents/justified-skill.tar.gz): the whole Claude Code skill, SKILL.md and every full rule, to unpack into .claude/skills/ (also as [zip](https://blackwoodblake.com/design-system/agents/justified-skill.zip)) - [AGENTS.md](https://blackwoodblake.com/design-system/agents/AGENTS.md): the same as plain Markdown - [AGENTS-full.md](https://blackwoodblake.com/design-system/agents/AGENTS-full.md): every rule in full, in one file - One rule in full: https://blackwoodblake.com/design-system/agents/rules/.md, for example https://blackwoodblake.com/design-system/agents/rules/frm-002a.md - [Registry](https://blackwoodblake.com/design-system/r/registry.json): the shadcn registry with the theme and components ## Areas - [Accessible button patterns for shadcn](https://blackwoodblake.com/design-system/patterns/actions/): Button labels, primary styles, button order, disabled submit buttons, target size, links versus buttons and drag and drop in shadcn apps, tried against WCAG 2.2. - [Colour contrast and motion patterns for shadcn](https://blackwoodblake.com/design-system/patterns/visual/): Contrast, colour tokens by role, colour and motion as the only sign, link underlines, hover, pressed and selected states, and reduced motion in shadcn apps. - [Delete confirmation and undo patterns for shadcn](https://blackwoodblake.com/design-system/patterns/destructive/): When to ask before a destructive action, when to offer Undo instead, and how a delete confirmation should work in a shadcn or React app. Tried against WCAG 2.2. - [Accessible dialog patterns for shadcn](https://blackwoodblake.com/design-system/patterns/dialogs/): How a shadcn or Radix dialog should handle Escape, focus, Tab, nested dialogs and delete confirmations. Rules tried against WCAG 2.2 and three design systems. - [Toast and status message patterns for shadcn](https://blackwoodblake.com/design-system/patterns/feedback/): Where to show success and failure in a shadcn or React app, when a toast is enough, how many actions it may hold, and how screen readers hear status messages. - [Accessible form patterns for shadcn](https://blackwoodblake.com/design-system/patterns/forms/): Labels, errors, validation timing, required fields, autocomplete, input types, paste, length limits and unsaved changes in shadcn and React forms, tried against WCAG 2.2. - [Keyboard and focus patterns for shadcn](https://blackwoodblake.com/design-system/patterns/keyboard/): Keyboard access, visible focus, focus hidden behind sticky headers and keyboard shortcuts in shadcn and React apps: what WCAG 2.2 requires and where apps go wrong. - [Responsive layout and reading order for shadcn](https://blackwoodblake.com/design-system/patterns/layout/): Layouts that work at 320 pixels, at 200 percent text and with wider text spacing, and grid or flex order that keeps reading and keyboard order intact, in shadcn apps. - [Navigation menu patterns for shadcn](https://blackwoodblake.com/design-system/patterns/navigation/): How a shadcn sidebar or top bar marks the current page, keeps its order on every page and offers a skip link, tried against WCAG 2.2 and design systems. - [Page structure patterns for shadcn](https://blackwoodblake.com/design-system/patterns/structure/): Page titles, headings in code, heading levels, landmarks, text for images and icons, and the page's language in shadcn and React apps, tried against WCAG 2.2. - [Loading and empty state patterns for shadcn](https://blackwoodblake.com/design-system/patterns/states/): Where to show a loading state, what an empty list or a search with no matches says, how a button shows it is saving, and session time-outs in shadcn apps. - [Accessible data table patterns for shadcn](https://blackwoodblake.com/design-system/patterns/tables/): Table headers in code, sortable columns, row actions the keyboard can reach and table titles for shadcn and TanStack Table, tried against WCAG 2.2. - [Error, tooltip and link text patterns for shadcn](https://blackwoodblake.com/design-system/patterns/text/): How to write error messages, when a tooltip is enough, how hover and focus content must behave, and how to write link text, for shadcn and React apps. ## 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. - [ACT-001a Start an action button with a verb that names the action](https://blackwoodblake.com/design-system/patterns/act-001a/): Rule. Unanimous (3 of 3), decided - [ACT-001b Give every button an accessible name that says what it does and contains its visible text](https://blackwoodblake.com/design-system/patterns/act-001b/): Rule. Requirement, decided - [ACT-002a Give at most one button in a group the most emphasised style](https://blackwoodblake.com/design-system/patterns/act-002a/): Rule. Unanimous (3 of 3), decided - [ACT-002b Use at most one primary button on a page](https://blackwoodblake.com/design-system/patterns/act-002b/): Rule. Majority (2 of 3), decided - [ACT-003a Put the confirming button last in a dialog's row of buttons](https://blackwoodblake.com/design-system/patterns/act-003a/): Rule. Unanimous (3 of 3), decided - [ACT-003b Put a page's buttons in the part they act on and keep them in the same place](https://blackwoodblake.com/design-system/patterns/act-003b/): Rule. Unanimous (3 of 3), decided - [ACT-004 Keep the submit button enabled on a form that does not fit on one screen](https://blackwoodblake.com/design-system/patterns/act-004/): Guideline, our choice. Split (1 of 2), decided - [ACT-005 Say next to an unavailable submit button what is still needed](https://blackwoodblake.com/design-system/patterns/act-005/): Rule. Unanimous (2 of 2), decided - [ACT-006 Make every pointer target at least 24 by 24 pixels, or pass the 24-pixel spacing test](https://blackwoodblake.com/design-system/patterns/act-006/): Rule. Requirement, decided - [ACT-007a Offer a way without dragging for everything people can drag](https://blackwoodblake.com/design-system/patterns/act-007a/): Rule. Requirement, proposed - [ACT-007b Tell assistive technology what each step of a keyboard move did](https://blackwoodblake.com/design-system/patterns/act-007b/): Guideline, our choice. Insufficient evidence (0 of 3 judges spoke), proposed - [ACT-008 Mark where a dragged item would land, and only while it is over that place](https://blackwoodblake.com/design-system/patterns/act-008/): Rule. Unanimous (2 of 2), proposed - [ACT-009 Give everything people click to go somewhere or to act the role of a control in code](https://blackwoodblake.com/design-system/patterns/act-009/): Rule. Requirement, proposed - [ACT-009a Build a control that only takes people somewhere as a link, also when it looks like a button](https://blackwoodblake.com/design-system/patterns/act-009a/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [ACT-009b Build a control that acts where the person is as a button, also when it looks like a link](https://blackwoodblake.com/design-system/patterns/act-009b/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [DLG-001 Let Escape do what Cancel does in a dialog](https://blackwoodblake.com/design-system/patterns/dlg-001/): Rule. Unanimous (3 of 3), decided - [DLG-002 Keep one dialog open at a time](https://blackwoodblake.com/design-system/patterns/dlg-002/): Rule. Unanimous (2 of 2), decided - [DLG-003 Name the action on the destructive button and always offer Cancel](https://blackwoodblake.com/design-system/patterns/dlg-003/): Rule. Unanimous (3 of 3), decided - [DLG-004 Never make the destructive button the default in a confirmation dialog](https://blackwoodblake.com/design-system/patterns/dlg-004/): 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](https://blackwoodblake.com/design-system/patterns/dlg-005/): 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](https://blackwoodblake.com/design-system/patterns/dlg-006/): Rule. Requirement, proposed - [DLG-007 Keep Tab inside a modal dialog and the page behind it out of use](https://blackwoodblake.com/design-system/patterns/dlg-007/): Rule. Unanimous (2 of 2), proposed - [DST-001a Make destructive actions reversible, and offer Undo instead of asking first](https://blackwoodblake.com/design-system/patterns/dst-001a/): 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](https://blackwoodblake.com/design-system/patterns/dst-001b/): Rule. Unanimous (3 of 3), decided - [FBK-002 Show a failed action where it started and keep it there](https://blackwoodblake.com/design-system/patterns/fbk-002/): Rule. Unanimous (3 of 3), decided - [FBK-003 Show a successful result in the view, not only in a toast that disappears](https://blackwoodblake.com/design-system/patterns/fbk-003/): Rule. Unanimous (3 of 3), decided - [FBK-004 Announce a status message without moving focus](https://blackwoodblake.com/design-system/patterns/fbk-004/): Rule. Requirement, decided - [FBK-005 Give a toast at most one action, keep it until it is used, and offer that action elsewhere too](https://blackwoodblake.com/design-system/patterns/fbk-005/): Rule. Unanimous (2 of 2), decided - [FRM-001 Give every form control a visible label](https://blackwoodblake.com/design-system/patterns/frm-001/): Rule. Majority (2 of 3), decided - [FRM-002a Show a field's error as text at the field](https://blackwoodblake.com/design-system/patterns/frm-002a/): Rule. Unanimous (2 of 2), decided - [FRM-002b Show a field's error when the person leaves the field or sends the form, and clear it as soon as the value is valid](https://blackwoodblake.com/design-system/patterns/frm-002b/): Rule. Unanimous (2 of 2), decided - [FRM-003 Give every form in a dialog a Cancel that always works and changes nothing](https://blackwoodblake.com/design-system/patterns/frm-003/): Rule. Unanimous (3 of 3), decided - [FRM-004a Ask before a full-screen dialog throws away unsaved changes, and only when something would be lost](https://blackwoodblake.com/design-system/patterns/frm-004a/): Rule. Unanimous (2 of 2), decided - [FRM-004b Ask before a dialog or sheet that does not fill the screen throws away unsaved changes, and only when something would be lost](https://blackwoodblake.com/design-system/patterns/frm-004b/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-004c Ask before leaving a page throws away unsaved changes, and only when something would be lost](https://blackwoodblake.com/design-system/patterns/frm-004c/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-004d Keep what people enter in a longer page form when they leave, and show that it is kept](https://blackwoodblake.com/design-system/patterns/frm-004d/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-005 Mark required or optional fields one way, in the label, with any symbol explained](https://blackwoodblake.com/design-system/patterns/frm-005/): Rule. Unanimous (2 of 2), decided - [FRM-007 Give fields for the person's own details the matching autocomplete value](https://blackwoodblake.com/design-system/patterns/frm-007/): Rule. Requirement, decided - [FRM-008 Let people sign in with paste, a password manager or a route with no test](https://blackwoodblake.com/design-system/patterns/frm-008/): Rule. Requirement, decided - [FRM-009 Fill in or offer what the person already gave earlier in the same process](https://blackwoodblake.com/design-system/patterns/frm-009/): Rule. Requirement, decided - [FRM-010 Give every form control a name in code that contains its visible label](https://blackwoodblake.com/design-system/patterns/frm-010/): Rule. Requirement, proposed - [FRM-011 When a form is sent with problems, move focus to the first problem or to a summary of them](https://blackwoodblake.com/design-system/patterns/frm-011/): Guideline, our choice. Insufficient evidence (0 of 3 judges spoke), proposed - [FRM-012a Changing a value does not send a form, open a page or move focus unless people were told first](https://blackwoodblake.com/design-system/patterns/frm-012a/): Rule. Requirement, proposed - [FRM-012b Let a control that holds a choice only record it, and put actions on buttons and links, even with a notice](https://blackwoodblake.com/design-system/patterns/frm-012b/): Rule. Majority (2 of 3), proposed - [FRM-013 Receiving focus never sends a form, opens a page, a window or a dialog that takes focus, or moves focus on](https://blackwoodblake.com/design-system/patterns/frm-013/): Rule. Requirement, proposed - [FRM-014 Give email, phone and web address fields the input type that matches the value](https://blackwoodblake.com/design-system/patterns/frm-014/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-014a Give a text field that takes only digits the digit keypad with inputmode](https://blackwoodblake.com/design-system/patterns/frm-014a/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-014b Put a string of digits that is not a quantity in a text input, never a number input](https://blackwoodblake.com/design-system/patterns/frm-014b/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-015 Let Enter in a single-line field send the form, as its main button does](https://blackwoodblake.com/design-system/patterns/frm-015/): Rule. Unanimous (3 of 3), proposed - [FRM-016a Let a click on a checkbox's or radio button's text change it, as a click on the box does](https://blackwoodblake.com/design-system/patterns/frm-016a/): Rule. Unanimous (2 of 2), proposed - [FRM-016b Let a click on a switch's text turn it on or off, as a click on the switch does](https://blackwoodblake.com/design-system/patterns/frm-016b/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-017 Let every text field take a pasted value, and never cut it without saying so](https://blackwoodblake.com/design-system/patterns/frm-017/): Guideline, our choice. Insufficient evidence (0 of 3 judges spoke), proposed - [FRM-017a Accept the spaces and separators people write in a number or code, and remove them before checking](https://blackwoodblake.com/design-system/patterns/frm-017a/): Guideline, our choice. Insufficient evidence (0 of 3 judges spoke), proposed - [FRM-017b State a free-text field's length limit and show how much is used](https://blackwoodblake.com/design-system/patterns/frm-017b/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [FRM-017c Say in words when a free-text limit is reached, and never cut text in silence](https://blackwoodblake.com/design-system/patterns/frm-017c/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [KBD-001 Let the keyboard do everything the pointer can, and show where focus is](https://blackwoodblake.com/design-system/patterns/kbd-001/): Rule. Requirement, decided - [KBD-002 Keep the focused element at least partly in view](https://blackwoodblake.com/design-system/patterns/kbd-002/): Rule. Requirement, decided - [KBD-003 Let people turn off or change a shortcut made only of character keys](https://blackwoodblake.com/design-system/patterns/kbd-003/): Rule. Requirement, proposed - [KBD-003a Show every shortcut the product adds, beside its command or in one list](https://blackwoodblake.com/design-system/patterns/kbd-003a/): Rule. Unanimous (2 of 2), proposed - [KBD-003b Build a shortcut on a modifier key by default](https://blackwoodblake.com/design-system/patterns/kbd-003b/): Rule. Unanimous (2 of 2), proposed - [LAY-001 Let the page fit a 320-pixel viewport without scrolling sideways](https://blackwoodblake.com/design-system/patterns/lay-001/): Rule. Requirement, decided - [LAY-002 Keep the order in the code telling the same story as the order on screen](https://blackwoodblake.com/design-system/patterns/lay-002/): Rule. Requirement, decided - [LAY-003a Let text grow to 200 percent without losing content or function](https://blackwoodblake.com/design-system/patterns/lay-003a/): Rule. Requirement, proposed - [LAY-003b Keep all text and functions intact when people widen the text spacing](https://blackwoodblake.com/design-system/patterns/lay-003b/): Rule. Requirement, proposed - [NAV-002a When a menu shows the current page, say so in the code on that item](https://blackwoodblake.com/design-system/patterns/nav-002a/): Rule. Requirement, proposed - [NAV-002b Mark the current page in a repeated menu with a cue that is not colour alone](https://blackwoodblake.com/design-system/patterns/nav-002b/): Rule. Unanimous (2 of 2), proposed - [NAV-003 Keep repeated navigation in the same order on every page](https://blackwoodblake.com/design-system/patterns/nav-003/): Rule. Requirement, proposed - [NAV-004 Start a page with a skip link when links come before its main content](https://blackwoodblake.com/design-system/patterns/nav-004/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [STA-001 Show a wait in the part that is loading, not over the whole page](https://blackwoodblake.com/design-system/patterns/sta-001/): Rule. Unanimous (3 of 3), decided - [STA-002a Say what will appear in a space that holds nothing yet, and offer the first step](https://blackwoodblake.com/design-system/patterns/sta-002a/): Rule. Unanimous (2 of 2), proposed - [STA-002b Never say a space is empty while its content is still loading](https://blackwoodblake.com/design-system/patterns/sta-002b/): Rule. Unanimous (2 of 2), proposed - [STA-003 When a search or filter matches nothing, say so and offer a way to change it](https://blackwoodblake.com/design-system/patterns/sta-003/): 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](https://blackwoodblake.com/design-system/patterns/sta-004/): Rule. Requirement, decided - [STA-005a Show that a sent action is under way until the reply comes](https://blackwoodblake.com/design-system/patterns/sta-005a/): Rule. Unanimous (3 of 3), proposed - [STA-005b While an action is being sent, a second press does not send it again](https://blackwoodblake.com/design-system/patterns/sta-005b/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [STR-001 Give every page a title that says what it is for, and change it with every view](https://blackwoodblake.com/design-system/patterns/str-001/): Rule. Requirement, proposed - [STR-002a Mark text that heads a part of the view as a heading in code](https://blackwoodblake.com/design-system/patterns/str-002a/): Rule. Requirement, proposed - [STR-002b Word each heading so it says what the part below it holds](https://blackwoodblake.com/design-system/patterns/str-002b/): Rule. Requirement, proposed - [STR-003 Give each view one h1 and every other heading the level its place in the outline gives it](https://blackwoodblake.com/design-system/patterns/str-003/): 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](https://blackwoodblake.com/design-system/patterns/str-004/): 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](https://blackwoodblake.com/design-system/patterns/str-005/): 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](https://blackwoodblake.com/design-system/patterns/str-006/): Rule. Requirement, proposed - [STR-006a Mark text in another language than the text around it with its own lang attribute](https://blackwoodblake.com/design-system/patterns/str-006a/): Rule. Requirement, proposed - [TBL-001 Build data in rows and columns as a table in code, with its headings marked as headers](https://blackwoodblake.com/design-system/patterns/tbl-001/): Rule. Requirement, proposed - [TBL-002 Put a keyboard sort control in a sortable header, and expose its order in code](https://blackwoodblake.com/design-system/patterns/tbl-002/): Rule. Requirement, proposed - [TBL-003 Give every row action its own control the keyboard reaches, and show hidden actions on focus](https://blackwoodblake.com/design-system/patterns/tbl-003/): Rule. Requirement, proposed - [TBL-004 Give every data table a visible title and tie it to the table in code](https://blackwoodblake.com/design-system/patterns/tbl-004/): Guideline, our choice. Insufficient evidence (1 of 3 judges spoke), proposed - [TXT-001a Say what went wrong, what it concerns and what to do next](https://blackwoodblake.com/design-system/patterns/txt-001a/): Rule. Unanimous (3 of 3), decided - [TXT-002a Let people close, hover and keep content that appears on hover or focus](https://blackwoodblake.com/design-system/patterns/txt-002a/): Rule. Requirement, decided - [TXT-002b Open tooltips on focus too, and keep what people need on the page](https://blackwoodblake.com/design-system/patterns/txt-002b/): 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](https://blackwoodblake.com/design-system/patterns/txt-003/): Rule. Requirement, decided - [VIS-001 Give text at least 4.5:1 contrast against the colour it is actually drawn on](https://blackwoodblake.com/design-system/patterns/vis-001/): Rule. Requirement, proposed - [VIS-002 Use each colour token only for the role and the pairs it was made for](https://blackwoodblake.com/design-system/patterns/vis-002/): Rule. Unanimous (3 of 3), proposed - [VIS-003a Never let colour be the only sign of what something means or which state it is in](https://blackwoodblake.com/design-system/patterns/vis-003a/): Rule. Requirement, proposed - [VIS-003b Make a link in running text stand out from the words around it by more than colour](https://blackwoodblake.com/design-system/patterns/vis-003b/): Rule. Requirement, proposed - [VIS-004 Give the edges and state marks of controls, and the parts of graphics people need, 3:1 contrast](https://blackwoodblake.com/design-system/patterns/vis-004/): Rule. Requirement, proposed - [VIS-005 Let people pause, stop or hide content that moves or updates by itself](https://blackwoodblake.com/design-system/patterns/vis-005/): Rule. Requirement, proposed - [VIS-006 Swap movement for a fade or no motion when the person asks for reduced motion](https://blackwoodblake.com/design-system/patterns/vis-006/): Rule. Unanimous (3 of 3), proposed - [VIS-007 Never let motion be the only sign of what happened](https://blackwoodblake.com/design-system/patterns/vis-007/): Rule. Unanimous (2 of 2), proposed - [VIS-008 Show a change on everything people can press, while it is pressed and while the pointer is over it](https://blackwoodblake.com/design-system/patterns/vis-008/): Rule. Unanimous (3 of 3), proposed - [VIS-008a Set every state a control shows in code on the control, and change it whenever the look changes](https://blackwoodblake.com/design-system/patterns/vis-008a/): Rule. Requirement, proposed - [VIS-008b Keep a selected or on state visible while the item is hovered, focused or pressed](https://blackwoodblake.com/design-system/patterns/vis-008b/): Rule. Unanimous (3 of 3), proposed ## Method - [Method](https://blackwoodblake.com/design-system/method/): how each rule is tried against WCAG 2.2 and design systems, and what the verdicts mean