Skip to content

KBD-003a Show every shortcut the product adds, beside its command or in one list

Level
Rule
Verdict
Unanimous (2 of 2)
Status
proposed, version 1.0.0

Rule

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.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: The menu item shows its keys

IMG_2041

Photos in Summer 2025: 3

The menu item Add to album shows Alt+A at its end, in text hidden from screen readers, so the item's name stays “Add to album”. The keys go to screen readers through aria-keyshortcuts, as the line under the frame shows. Click inside the frame, then press Alt+A: the shortcut works, and the menu item does the same. The keys are matched on the physical key, so Option works on a Mac.

Do: A tooltip with the name and keys

The icon button is named Rotate left, and its tooltip adds the keys: “Rotate left (Alt+L)”. The tooltip opens when the button gets keyboard focus as well as on hover, so Tab to the button, or click inside the frame and press Alt+L to rotate the photo. The keys are not part of the button's name. On a Mac the tooltip and the menu item show Option, the key's name there.

Don't: A shortcut that is shown nowhere

IMG_2041

Photos in Summer 2025: 3

The same photo page, with the same shortcut, Alt+A, but the menu item shows nothing and gives screen readers nothing. Click inside the frame and press Alt+A: it works, but nothing in the page ever told you that it would.

Don't: The keys written into the button's name

Inbox

The button reads “Search Ctrl K”, so its accessible name carries the keys. Someone using voice control has to say “Search Ctrl K” to press it, and a screen reader reads the keys as part of the name. Click inside the frame and press Ctrl+K to try the shortcut. The keys belong in a separate element that is hidden from assistive technology, with aria-keyshortcuts beside it.

Why

A shortcut nobody knows about helps nobody. The interface has little room to teach keys, so people learn them where the command lives or in one list they can return to. That matters most to the people who lean on the keyboard all day, and to anyone who needs to know which keys the page has taken before turning some of them off. No Level A or AA criterion asks that shortcuts be made known. WCAG 2.2, 2.1.1 Keyboard is met by the visible control that KBD-001 asks for, and 2.1.4 Character Key Shortcuts only needs a way out to exist. Both are better served when people can see the shortcuts, but neither requires it, so this rule rests on the judges.

Do

  • In a photo library, the menu item Add to album shows Alt+A at its end in a DropdownMenuShortcut, and the command menu shows the same keys beside Add to album. That span sits inside the item, so its text joins the item's name; give it aria-hidden and put the keys in aria-keyshortcuts on the item. Match Alt shortcuts on e.code, as KBD-003b says, so they work with Option on a Mac.
  • Give an icon button a tooltip with its name and keys, such as "Rotate left (Alt+L)", and show it on keyboard focus as well as on hover. The name itself is set on the button, as ACT-001b asks; the tooltip only shows it with the keys.
  • Or gather them: a dialog Keyboard shortcuts, opened from Help in the user menu, lists every shortcut grouped by area, such as Library, Album and Editor. Once single-key shortcuts are turned on (KBD-003b), ? may open it too, but the menu item must, or only people who already know the key find the list. ? is a character key, so KBD-003 applies to it.
  • Shortcuts that act only inside one component, such as j and k in the photo grid, count too. Give the grid a short hint or list them under their own heading in the dialog.
  • Put the switch that turns single-key shortcuts off, which KBD-003 asks for, in or next to the list, so people find both in one place.
  • Keep the keys out of the control's name. Show them in a separate element, for example inside aria-hidden text next to the label, and give them to screen readers with aria-keyshortcuts. This is our own advice.
  • Show Cmd on a Mac and Ctrl on Windows and Linux, read from navigator.userAgentData?.platform or navigator.platform. This is our own advice.
  • Our own advice: show only keys that work. CommandShortcut, DropdownMenuShortcut, ContextMenuShortcut and Kbd in shadcn only draw text; bind the keys they show.

Don't

  • Bind Alt+A with useHotkeys and show it nowhere, so people only learn of it by accident.
  • Open the list of shortcuts only by ?, with no link to it anywhere on screen.
  • Put the keys only in a title attribute, which shows on mouse hover and never on keyboard focus, or only in aria-keyshortcuts, which reaches screen readers and nobody else.
  • Name a button "Search Ctrl K", so a voice control user must say the keys to press it.
  • Show ⌘S beside Save to everyone, so people on Windows press a key their keyboard does not have.

Exceptions

  • Keys that are not the product's. The browser's, the operating system's and the screen reader's own keys need no listing.
  • The standard keys of a control. Arrow keys in a menu, Escape in a dialog, Enter in a form and typeahead in a listbox come with the control and are not shortcuts the product adds.
  • Neighbouring rules. A shortcut is always an extra beside a visible control (KBD-001). Listing a single-key shortcut does not make it acceptable; it still needs a way out (KBD-003). Which keys to choose is KBD-003b.

Verdict

Unanimous (2 of 2). Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on KBD-003a
SourceRoleStancePage
WCAG 2.2LawSupports2.1.1 Keyboard
WCAG 2.2LawSupports2.1.4 Character Key Shortcuts
Material DesignJudge SupportsAccessibility designing: flow
Snackbar: accessibility
Apple Human Interface GuidelinesJudge SupportsThe menu bar (macos, ipados)
Menus
Carbon Design SystemJudge No position
GOV.UK Design SystemExpert witness No position
Nielsen Norman GroupExpert witness SupportsUI Copy: UX Guidelines for Command Names and Keyboard Shortcuts, by Anna Kaley
User Control and Freedom (Usability Heuristic #3), by Maria Rosala

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Keyboard: 5 rules and 0 guidelines · All rules