# Justified behaviour rules

These are the behaviour rules of Justified by Blackwood & Blake: how forms, buttons, dialogs and other parts of an interface should behave in a shadcn app. Each one was tried against WCAG 2.2 and weighed by established design systems; the verdict says how strongly they agree. Following them helps you work toward WCAG 2.2 AA. It does not make a product compliant on its own and is not a certification.

## How to use this file

- This file holds 79 rules and 23 guidelines, each as one short statement. Keep them in mind whenever you build, change or review interface code.
- Before you write or review code that an entry covers, read its full rule at the link after it: Why, Do, Don't and Exceptions. Apply the exceptions only as written.
- Prefer Justified's components where they exist. They already follow the rules. Install them with the shadcn CLI, for example `npx shadcn@latest add https://blackwoodblake.com/design-system/r/field.json`, and the theme with `npx shadcn@latest add https://blackwoodblake.com/design-system/r/justified-theme.json`.
- When you review code, name each rule by its id, for example "FRM-002a".
- Entries marked "proposed" are complete but may still change. The others are decided: what they ask is not expected to change, though their wording may still be made clearer.

## Rules and guidelines

- **A rule that WCAG requires:** follow it. If the person you work for asks for something else, do what they ask, and tell them that a WCAG 2.2 Level AA criterion is involved, by number and name.
- **Any other rule:** follow it. If the person you work for asks for something else, do what they ask, and tell them which rule it departs from and why the rule exists.
- **A guideline:** follow it where the project has no convention of its own. Where the project already does it another way, keep the project's way and say nothing.
- **When two apply:** a rule that WCAG requires comes before other rules, a narrower rule before a wider one, and any rule before a guideline.

Every rule and guideline, with its verdict and the sources behind it: https://blackwoodblake.com/design-system/patterns/

## Rules that WCAG 2.2 AA requires

A WCAG 2.2 Level AA criterion requires the behaviour. Where a rule adds advice of our own, the rule says so.

- **ACT-001b** Give a button that shows no text an accessible name that says what pressing it does, not what its icon pictures. Give a button that shows text an accessible name that contains the visible words in the same order; case and punctuation may differ. Starting the name with the visible text is our advice, not a requirement. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-001b.md)
- **ACT-006** Make every target that people press with a pointer at least 24 by 24 CSS pixels, or place it so that a circle 24 CSS pixels across, centred on its bounding box, touches no other target and no other small target's circle. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-006.md)
- **ACT-007a** Anything people can do by dragging on the page can also be done with a single pointer and no dragging, such as buttons, a menu or a field. A keyboard route alone does not count, and the other way may not be a swipe or another gesture that follows a path. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-007a.md)
- **ACT-009** Everything people click or tap to go somewhere or to act has a control role in code, such as link or button. Something shown as a link whose only job is to take people to another address has the link role. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-009.md)
- **DLG-006** When a modal dialog opens, keyboard focus moves into it. When it closes, focus returns to the control that opened it, or to a logical place nearby if that control is gone. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/dlg-006.md)
- **FBK-004** When a message about a result, a wait, progress or an error appears while focus stays where it is, give it a role or property that lets assistive technology announce it without it taking focus. Our own way, which WCAG does not prescribe, is a polite live region, with role="alert" kept for an error or warning that needs attention now. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/fbk-004.md)
- **FRM-007** When a field asks for the person's own details and WCAG 2.2 lists a matching input purpose, give the field the exact `autocomplete` value for that purpose and never remove it. Our own addition, which 1.3.5 does not ask for: never stop the browser or a password manager from filling the field in. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-007.md)
- **FRM-008** At every step of signing in, let user name, password and code fields take a pasted value in one go and be filled by the browser or a password manager, ask for selected characters of a secret only if another route needs no such step, and give any other test, such as a CAPTCHA, a route without a test. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-008.md)
- **FRM-009** Within one process, when a step needs information the person already entered or the service already showed them, either put it in the field or offer it on the same page to pick, and never make them type it again. Our own addition, which 3.3.7 does not ask for: a value put in the field stays editable. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-009.md)
- **FRM-010** Give every form control a name in code that assistive technology can read. When a control has a visible text label, its name contains that text. When a group's options need the group label to make sense, that label can be read in code together with the options. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-010.md)
- **FRM-012a** Changing a control's value, such as choosing an option, ticking a box or typing, does not send a form, open a page, a window or a dialog that takes focus, or move focus, unless text before the control tells people it will. Changes in place, such as a list that filters, are allowed while focus stays put. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-012a.md)
- **FRM-013** When a control receives focus, by Tab, a click or a script, that alone never sends a form, opens a page, a window or a dialog that takes focus, or moves focus to another control. A notice before the control does not change this. Content that appears beside the control and leaves focus in it is allowed. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-013.md)
- **KBD-001** Everything a person can do with a pointer can also be done with the keyboard alone, unless the task depends on the path of the movement; and whenever an element has keyboard focus, a visible indicator marks it for as long as it has focus. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/kbd-001.md)
- **KBD-002** When an element has keyboard focus, at least part of it stays in view: no sticky header or footer, toast, cookie banner, chat button or panel that the page put on screen may cover it completely. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/kbd-002.md)
- **KBD-003** When the page reacts to a shortcut made only of character keys (letters, digits, punctuation or symbols, with or without Shift), people can turn it off or change it to include a key that types nothing, such as Ctrl, Alt or Cmd, unless it works only while its own control has focus. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/kbd-003.md)
- **LAY-001** When the viewport is 320 CSS pixels wide, every piece of content and every function is still there. Nothing needs scrolling in two directions to be read or used, except a part that needs two dimensions to be understood or used, such as a data table or a map. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/lay-001.md)
- **LAY-002** Where the order of content carries meaning or affects how it is used, the order in the code, which screen readers read and the keyboard follows, tells the same story as the order on screen, and layout tools such as grid placement or the order property never rearrange that content so the two disagree. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/lay-002.md)
- **LAY-003a** Text, also in controls and labels, can be enlarged to 200 percent without losing content or function: nothing is cut off, laid over other content or stops working. Do not switch off zoom or cap it below 200 percent in the viewport setting, and size no text in viewport units alone. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/lay-003a.md)
- **LAY-003b** When a person sets line height to 1.5 times the font size, space after paragraphs to 2 times, letter spacing to 0.12 times and word spacing to 0.16 times, no text is cut off, hidden or laid over other content, and every function still works. The page need not use these values itself. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/lay-003b.md)
- **NAV-002a** When a navigation menu shows which item is the page the person is on, the code or the text says so too, so a screen reader announces that item as the current page. The usual way is `aria-current="page"` on its link. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/nav-002a.md)
- **NAV-003** Navigation that repeats on several pages of a product, such as a top bar, a sidebar or a row of footer links, lists its items in the same relative order on every page, unless the person changed the order themselves. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/nav-003.md)
- **STA-004** When the product sets a time limit that can end a person's chance to act or throw away their work, let them turn it off, lengthen it, or extend it after a warning, unless an exception applies. Each option meets 2.2.1 only with the conditions listed for it first under Do. Our advice is to prefer them in that order. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/sta-004.md)
- **STR-001** Give every page a title, in the `title` element, that says what the page holds or is for. In a single page app, set a new title on every route change, so the title names the view now shown, not only the app. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-001.md)
- **STR-002a** When text heads a part of the view, such as a section, a card, a panel or a dialog, mark it as a heading in code, not only with bold or large type. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-002a.md)
- **STR-002b** Word every heading so it says what the part below it holds or is for. A heading that would fit any part of any page, such as "Details" or "Section 2", does not. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-002b.md)
- **STR-005** Give an image or icon that carries information a text alternative that says what it tells the person in that place, never a file name or a word that only names the kind of picture. Hide one that only decorates from assistive technology, with `alt=""` on an `img` or `aria-hidden="true"` on an icon. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-005.md)
- **STR-006** Put a `lang` attribute on the `html` element whose value is a valid language tag for the language most of the page is written in. When the interface switches to another language without loading a new page, change the attribute to that language at the same time. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-006.md)
- **STR-006a** When a passage, phrase or word is in another language than the text around it, put `lang` with that language's tag on the element that holds it, such as language picker entries written in their own languages. Proper names, technical terms, words of unclear language and words the surrounding language has taken in need none. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-006a.md)
- **TBL-001** When values are shown in rows and columns under headings, build them as a table in code. Mark each heading cell as the header of its column or row, so assistive technology can tell which headings every value belongs to. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/tbl-001.md)
- **TBL-002** When a column's header sorts the table, make the sort a button or link inside the header cell that works from the keyboard. Expose the sorted column's order in code, ascending or descending, so the direction is never shown by an arrow icon alone. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/tbl-002.md)
- **TBL-003** Give every action a table row offers its own control the keyboard reaches, such as a link, a button or a menu item. A click on the row may be a shortcut, never the only way. An action hidden until the pointer hovers the row is visible whenever it has focus. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/tbl-003.md)
- **TXT-002a** Content that appears on hover or keyboard focus can be closed without moving the pointer or focus, usually with Escape. If hover opens it, the pointer can move onto it without it closing. It stays until the hover or focus that opened it ends, the person closes it, or it is no longer true. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/txt-002a.md)
- **TXT-003** Let people tell where each link goes or what it opens from its visible text, its accessible name, or its text with the list item, table cell, paragraph or sentence around it; an added name keeps the visible words. A vague phrase with nothing around it naming the destination is not enough. Requirement. [Full rule](https://blackwoodblake.com/design-system/agents/rules/txt-003.md)
- **VIS-001** Text people need to read reaches 4.5:1 against the colour it is drawn on, or 3:1 when it is large. Measure after opacity, tints, overlays and images have done their work, in every state. Text in an inactive control, decoration and logos are exempt; see Exceptions. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-001.md)
- **VIS-003a** Never let colour be the only sign of what something means or which state it is in, such as a status, an error or a selection. Add text, an icon, a shape or a pattern. A lightness difference of 3:1 counts too, except where people must know what a particular colour means. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-003a.md)
- **VIS-003b** A link in running text stands out from the words around it at rest, not only on hover or focus: by a cue that is not colour, such as an underline, or by 3:1 lightness against the surrounding text. Justified's tokens close the 3:1 route, so a cue is needed; our own choice is an underline. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-003b.md)
- **VIS-004** The parts people need to see to find a control and tell its state, and the parts of a graphic they need to understand it, reach 3:1 against the colours next to them. Inactive controls, decoration and graphics whose information is also given in text are exempt. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-004.md)
- **VIS-005** When something starts by itself and shares the screen with other content, give a way to pause, stop or hide it if it moves, blinks or scrolls for more than five seconds. If it updates by itself, such as an auto-playing carousel, give that way, or a way to set how often, at any length. Essential motion is exempt. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-005.md)
- **VIS-008a** When a control shows a state, such as on or off, selected, checked, expanded or unavailable, that state is also set in code on the control itself. Whenever the look changes, the state in code changes with it. Requirement, proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-008a.md)

## Rules the judges decide

No WCAG criterion requires these. Most or all of the design systems that addressed the question support them.

- **ACT-001a** Start the label of every button that performs, confirms or commits an action with a verb naming that action. Add the object unless the verb and its context say what it acts on; where the verb repeats or space is tight, it may go in the accessible name instead (ACT-001b). Never use OK, Yes, No, Submit or a noun alone. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-001a.md)
- **ACT-002a** Among the buttons shown together for one task or decision, such as the action row of a form, dialog, sheet or card, give at most one the most emphasised style, for the action most people want there, and give every other button a less emphasised style; a group may have no emphasised button at all. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-002a.md)
- **ACT-002b** Give a page at most one button in the most emphasised style, `default` or `destructive`, for the main task of the page; a dialog, sheet or side panel counts as its own page while it is open, and the actions of other sections, cards and smaller tasks use less emphasised styles. Majority (2 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-002b.md)
- **ACT-003a** When a dialog's action buttons sit side by side, put the confirming or primary button last, at the trailing end of the row (the right in left-to-right languages, the left in right-to-left), with Cancel or the other dismissive action before it and no action button after it. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-003a.md)
- **ACT-003b** On a page, put a button that acts on one part inside that part, and a button that acts on the whole page in the page's own header, action bar or floating button. Give the same task the same area and position on every page at a given window size. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-003b.md)
- **ACT-005** When a button that submits or continues a form is unavailable because required input is missing, show visible text directly before the button in reading order that says what the person must still do to make it work, and make that text readable without focusing the button. A required value that is filled in but not valid counts as missing. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-005.md)
- **ACT-008** While something is being dragged, mark on screen the place that would receive it if it were let go now. Remove the mark as soon as the dragged thing leaves that place, is dropped or the drag is cancelled. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-008.md)
- **DLG-001** In a dialog that has a dismissive action, which is Cancel, Close, a close icon or, where none of those exists, the button that leaves everything as it is, pressing Escape does exactly what that action does, including any check before unsaved input is thrown away, and never confirms, submits or runs the destructive or default action. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/dlg-001.md)
- **DLG-002** Never open a dialog on top of another dialog. Show any further step, including a question about discarding typed input, by replacing the open dialog's content, and a failed main action as a notice inside it, or close the dialog and move the work to a page. Only a full-screen dialog may have a short confirmation or alert on top. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/dlg-002.md)
- **DLG-003** In a dialog that asks the person to confirm a destructive action, label the button that performs it with a verb that names that action, never "OK", "Yes" or another word that does not say what will happen, and always include a button labelled Cancel that is enabled and closes the dialog with nothing changed. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/dlg-003.md)
- **DLG-007** While a modal dialog is open, Tab and Shift+Tab stay within it, and nothing behind it can be used until it closes. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/dlg-007.md)
- **DST-001a** Make destructive and other significant actions reversible wherever the product can, and when an action can be fully reversed, carry it out at once and offer Undo right after it. DST-001b decides when a question is still needed; it never is for a routine action that Undo fully reverses. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/dst-001a.md)
- **DST-001b** Ask the person to confirm a step only when it cannot be reversed and destroys, spends or commits something of value, or when a mistake would cost a lot and be hard to put right, such as a charge to a card; never ask before any other step. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/dst-001b.md)
- **FBK-002** When an action fails for a reason not tied to one field or group of inputs, show the failure as text in the area where it started. Keep it there until the person closes it, a retry succeeds or they leave the view, and never let a self-closing message carry it alone. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/fbk-002.md)
- **FBK-003** After an action succeeds, the item or value it changed shows its new state in the view. If the result has no place in the view, leave a lasting sign near the control or somewhere the person can return to. A toast that closes by itself is never the only sign. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/fbk-003.md)
- **FBK-005** A toast or snackbar holds at most one action button besides its close control. While it holds one, it stays until the person uses it, closes it or leaves the view, or a newer message makes it moot. Its action can also be done from a place that lasts. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/fbk-005.md)
- **FRM-001** Give every form control a label that people can see at the control, beside it, above it or on its border, before, while and after they fill it in, and never let placeholder text stand in for that label. Majority (2 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-001.md)
- **FRM-002a** When a field or a group of inputs has an invalid value, show the error as visible text at that field, and never only in a banner, a dialog or a tooltip somewhere else. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-002a.md)
- **FRM-002b** Show a new error on a field only when the person leaves it after changing it or sends the form, never while they type; recheck an error that is already shown on every change and remove it as soon as the value is valid. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-002b.md)
- **FRM-003** Every form in a dialog, sheet or other modal view has a visible Cancel button that is always enabled, is never blocked by field errors, sends nothing and leaves everything as it was before the form opened. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-003.md)
- **FRM-004a** When closing a full-screen dialog would throw away changes the person has not saved, ask first, whichever way they close it, with *Cancel* to keep everything and a button that names the discard; when nothing would be lost, close at once. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-004a.md)
- **FRM-005** When a form marks required or optional fields, give every field of the same status the same marker, put it in the visible label or the group's legend as part of the accessible name, and explain a symbol in visible text no later than the first marked field. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-005.md)
- **FRM-012b** A control that holds a choice, such as a select, radio group, checkbox, switch or filter chip, only records it and may update the view in place. Going to another page or step, sending a form or running a command takes a button, a link or a menu of actions, even with a notice. Majority (2 of 3), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-012b.md)
- **FRM-015** In a form, pressing Enter in a single-line field, such as a text, email, number or search input, sends the form, the same as pressing its main button. Unanimous (3 of 3), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-015.md)
- **FRM-016a** When a checkbox or a radio button shows its own text beside it, a click, tap or pen press on that text checks or unchecks the checkbox, or selects the radio button, exactly as a press on the box or circle does. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-016a.md)
- **KBD-003a** Every keyboard shortcut the product adds can be found inside the product: shown beside the command it triggers, such as in a menu item or tooltip, or listed with the others in one place, such as a shortcuts dialog or help page. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/kbd-003a.md)
- **KBD-003b** A keyboard shortcut the product adds includes a modifier key (Ctrl, Alt or Cmd) or Shift by default. A single key, such as `n` or `/`, works as a shortcut only after the person turns such shortcuts on, or only while its own control has focus. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/kbd-003b.md)
- **NAV-002b** A navigation menu that repeats across pages marks the item for the page or section the person is in, and only that item. The mark does not rest on colour alone: use heavier text, a filled icon, a shape behind the item or a bar beside it. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/nav-002b.md)
- **STA-001** When content in one part of a view loads, show the wait in that part, at the control that started it or as a small indicator where the content will appear, never as a layer over the whole page, and keep the rest of the view usable. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/sta-001.md)
- **STA-002a** When a list, table, panel or page has finished loading and holds nothing yet, show a short message in that space that says what will appear there. When the person can add the first item, offer that action as one button or link with the message. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/sta-002a.md)
- **STA-002b** While a list, table or panel is still fetching its content, show that it is loading, never that it is empty. Show the message that there is nothing only after the fetch has finished and returned no items. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/sta-002b.md)
- **STA-005a** When a button sends, saves or deletes something and the reply does not come at once, show that the action is under way until the reply comes. Unanimous (3 of 3), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/sta-005a.md)
- **STR-004** Build the page's regions from landmark elements: the main content in `main`, the top bar in `header`, each group of navigation links in `nav` and the bottom bar in `footer`. When a page has more than one `nav`, give each a name that tells them apart. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-004.md)
- **TXT-001a** Every message about a problem says in plain words what went wrong, names the thing it concerns by the name the person sees, and gives a next step: the fix when it is known, otherwise a retry, a wait or where to get help. Unanimous (3 of 3). [Full rule](https://blackwoodblake.com/design-system/agents/rules/txt-001a.md)
- **TXT-002b** A tooltip opens when its trigger gets keyboard focus, not only when the pointer rests on it. It holds only extra help. Anything the person needs to finish the task is visible on the page without hovering or focusing. Unanimous (2 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/txt-002b.md)
- **VIS-002** Use a `*-foreground` token only on its own fill, `border-input` for the edges of controls, and a state colour such as `ring`, `destructive` or `accent` only for its state. Never use raw palette classes such as `text-gray-500` for something that carries meaning. Unanimous (3 of 3), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-002.md)
- **VIS-006** When the person's device or browser asks for reduced motion, replace movement across the screen, such as sliding, zooming, scaling, parallax and bouncing, with a short fade or an instant change. Stop motion that only decorates and show its final state. Keep motion that is essential. Unanimous (3 of 3), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-006.md)
- **VIS-007** Never let an animation be the only way the interface says something. Whatever it means, such as an error, a change, a new item or that something is live, is also shown in text, an icon or a state that stays on screen when the motion has ended or is turned off. Unanimous (2 of 2), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-007.md)
- **VIS-008** Everything that does something when pressed, including a clickable card, row or list item, changes its look while it is pressed and, where the pointer can hover, while the pointer is over it. A control that is off shows neither change. Unanimous (3 of 3), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-008.md)
- **VIS-008b** A state that lasts, such as selected, checked, on or current, stays visible while the same item is also hovered, focused or pressed. The look of hover, focus or press is never the same as the look of a state that lasts. Unanimous (3 of 3), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/vis-008b.md)

## Guidelines, our choice

The design systems are divided, or fewer than two have addressed the question. We chose, and each guideline gives our reasons. A product that chooses otherwise is not wrong.

- **ACT-004** On a form that does not fit on one screen at the smallest screen size the product supports, without the on-screen keyboard, keep the submit button enabled until the form is sent. A Next or Continue button on a step of a multi-step form counts as the submit button for that step. Split (1 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-004.md)
- **ACT-007b** When an item can be moved with the keyboard, tell assistive technology in words when it is picked up, where it is after each step, and where it was dropped or that the move was cancelled, using its visible label and positions such as "2 of 5". Insufficient evidence (0 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-007b.md)
- **ACT-009a** When a control not shown as a link only takes people to another address, such as a page or a spot on a page, build it as a link in code, not as a button that changes the address by script. A control that acts and then moves on stays a button. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-009a.md)
- **ACT-009b** A control that acts where the person is, such as saving, deleting, switching something or opening a dialog or menu, is a button in code, also when it is styled as a link. Do not build it as an `<a>` with `href="#"` or `javascript:void(0)`, or as a link whose click is cancelled by script. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/act-009b.md)
- **DLG-004** In a dialog that asks the person to confirm a destructive action, put initial focus on the Cancel button, never on the destructive button, and never let Enter run the destructive action unless the person has moved focus to that button. Split (1 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/dlg-004.md)
- **DLG-005** In a dialog that asks the person to confirm a destructive action, give the destructive button the danger style, even when the person has just asked for that action. Its label still names the action, as DLG-003 says, so colour is never the only sign of danger. Split (1 of 2). [Full rule](https://blackwoodblake.com/design-system/agents/rules/dlg-005.md)
- **FRM-004b** When closing a dialog or sheet that does not fill the screen would throw away changes the person has not saved, ask first, whichever way they close it. The question offers *Cancel*, which keeps everything, and a button that names the discard. When nothing would be lost, close at once. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-004b.md)
- **FRM-004c** When leaving a page would throw away unsaved form changes, ask first, by every route out: inside the product with *Cancel* to stay and a button naming the discard, and on closing or reloading the tab with the browser's own prompt. When nothing would be lost, leave at once. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-004c.md)
- **FRM-004d** On a page form with a multi-line text field, more than one step, or five or more controls, a radio or tick-box group counting as one, keep what the person enters when they leave: save each change or keep a draft to return to. Show near the form that it is kept. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-004d.md)
- **FRM-011** When a form is sent and problems are found at its fields, in the browser or by the server, move focus to the first field with a problem, or to a summary above the form that links to each problem. This holds for every form: short or long, page or dialog, and each step of a multi-step form. Insufficient evidence (0 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-011.md)
- **FRM-014** Give a field that asks only for an email address `type="email"`, a field for a phone number `type="tel"` and a field for a web address `type="url"`. A phone or tablet then shows a keyboard with the keys that value needs. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-014.md)
- **FRM-014a** When a text field takes a value made of digits only, other than a phone number, give it `inputMode="numeric"`. When it takes an amount or measurement with a decimal part, give it `inputMode="decimal"`. A phone or tablet then shows a digit keypad. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-014a.md)
- **FRM-014b** Put a string of digits that is not a quantity, such as a one-time code, a card number, an account number, a phone number or a postcode, in a text input: `type="text"`, or `type="tel"` for a phone number. Never put it in `type="number"`. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-014b.md)
- **FRM-016b** When a switch shows its own text beside it, a click, tap or pen press on that text turns the switch on or off exactly as a press on the switch does. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-016b.md)
- **FRM-017** Outside sign-in, which FRM-008 covers, let every text field and text area take a pasted value. Never block a paste, and never cut or drop pasted characters without saying so. Removing separators from the value that is checked, as FRM-017a describes, is not such a change. Insufficient evidence (0 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-017.md)
- **FRM-017a** When a field takes a number or code people write in several ways, such as a phone or card number, accept the spaces, hyphens, brackets, dots and letter case they type or paste, and remove them before checking. Insufficient evidence (0 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-017a.md)
- **FRM-017b** When a free-text field limits how many characters or words it takes, state the limit in its label or hint and show how much is used in a count that is tied to the field in code. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-017b.md)
- **FRM-017c** When a free-text field limits how many characters or words it takes, say in words when people reach or pass the limit. Never stop or cut typed or pasted text without saying so. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/frm-017c.md)
- **NAV-004** When a header or sidebar with links comes before a page's main content, make a skip link the first thing Tab reaches. It is visible while it has focus, and it moves focus to the start of the main content. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/nav-004.md)
- **STA-003** When a search or filter matches nothing, say in the results space that nothing matched, and offer a way to change or clear the search or the filters. Our own choice: name what was searched for or filtered by, and keep the query and the filters in place, ready to edit. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/sta-003.md)
- **STA-005b** While an action is being sent, another press on the same button does not send it again, whether it comes as a click, a tap, Enter or Space. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/sta-005b.md)
- **STR-003** Give each view one `h1` that names its main content. Give every other heading the level its place in the outline gives it: one below the heading it belongs under. Going down never skips a level; going back up may skip as many as needed. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/str-003.md)
- **TBL-004** Give every data table a visible title that says what its rows have in common. Tie that title to the table in code, as its `caption` or through `aria-labelledby`. Insufficient evidence (1 of 3 judges spoke), proposed. [Full rule](https://blackwoodblake.com/design-system/agents/rules/tbl-004.md)

---

Rule texts © Carl Magnus Swahn and Justified contributors, licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Generated from 79 rules and 23 guidelines.
