# Pointer and keyboard {#c12}

> Chapter 12 of the App Design Guide 3.0.0. Index: https://www.designguide.dev/llms.txt

A mouse, a trackpad, and a keyboard give more ways to act than a finger does. A phone has no hover and no right-click, so each rule keeps a touch path: hover content shows on press or stays visible ([Rule 12.3](https://www.designguide.dev/r/match-hover-with-focus.md)), a context menu is a More button or a long press ([Rule 12.14](https://www.designguide.dev/r/open-the-same-menu-on-touch-and-keyboard.md)), selection is a select mode ([Rule 12.26](https://www.designguide.dev/r/select-rows-with-a-checkbox-or-with-modifiers.md)), a drag starts with a long press or a handle ([Rule 15.15](https://www.designguide.dev/r/give-every-drag-a-non-drag-path.md)), and the command menu is a search plus a visible menu ([Rule 4.12](https://www.designguide.dev/r/put-search-above-what-it-searches.md)).

## Hover {#s12-1}

### 12.1 Let hover only add  {#let-hover-only-add}

Hard

**Rule:** Give every function a visible or keyboard path, and use hover only to add a faster route to it.

**Why:** Touch screens, keyboards, and screen readers cannot hover, so a hover-only function locks them out.

- Put each hover action in a menu, a count bar, or a key.
- Test each screen with the pointer put away and the keyboard only.

**Picture:** Do: Actions show on hover. A More button always shows. Don't: Delete exists only on hover.

### 12.2 Reveal only extras on hover  {#reveal-only-extras-on-hover}

Default · Desktop only

**Rule:** Reveal on hover only a name, a row action, a preview, or a resize grip, and never a fact the person needs.

**Applies with:** Hover, Fine pointer

**Why:** Hover content goes away when the pointer moves, so needed facts stay on the page.

- A link preview card shows facts that the link page holds.
- On touch, show it on press or keep it visible ([Rule 12.3](https://www.designguide.dev/r/match-hover-with-focus.md)).

| Hover can show | This must stay true |
| --- | --- |
| The name of an icon-only button | A screen reader reads the same name |
| The quick actions of a row | A menu or a count bar holds the same actions |
| A preview of a link target | The page behind the link holds the same facts |
| A resize grip on a divider | A key resizes the pane too |

**See:** [12.3 Match hover with focus](https://www.designguide.dev/r/match-hover-with-focus.md)

### 12.3 Match hover with focus  {#match-hover-with-focus}

Hard

**Rule:** Show on keyboard focus whatever hover shows, and give every pressable thing a hover state.

**Why:** A keyboard user needs the same actions, and a hover state shows that a thing is live.

- Give each button, row, tab, link, and menu item a hover state.
- Show the focus ring and the hover state together when both apply.
- Focus ring: [Rule 15.12](https://www.designguide.dev/r/show-a-visible-focus-ring.md). Dismissing hover content: [Rule 15.29](https://www.designguide.dev/r/keep-hover-content-dismissible-and-hoverable.md).

**Picture:** Figure: The same two actions show for the pointer and for the keyboard.

**See:** [15.12 Show a visible focus ring](https://www.designguide.dev/r/show-a-visible-focus-ring.md), [15.29 Keep hover content dismissible and hoverable](https://www.designguide.dev/r/keep-hover-content-dismissible-and-hoverable.md)

### 12.4 Time hover reveals  {#time-hover-reveals}

Default · Desktop only

**Rule:** Open a submenu after 100 ms, open a preview card after 600 ms, and close it 300 ms after the pointer leaves.

**Applies with:** Hover, Fine pointer

**Why:** An instant open flickers, and an instant close cuts off a person who aims at the content.

- Let Esc close hover content without a pointer move.
- Let the pointer move into the hover content.
- Keep it open until the person dismisses it or the pointer leaves.

| Hover part | Opens | Closes |
| --- | --- | --- |
| Row actions | At once | When the pointer leaves the row |
| Submenu | After 100 ms | When another item gets hover |
| Preview card | After 600 ms | 300 ms after the pointer leaves |
| Any hover content | Esc closes it | The pointer can enter it first |

### 12.5 Never open a blocking layer on hover  {#never-open-a-blocking-layer-on-hover}

Default · Desktop only

**Rule:** Open only light layers on hover, such as a hint or a preview, and never a dialog or a page.

**Applies with:** Hover, Fine pointer

**Why:** A blocking layer that opens by accident traps people, while a light layer lets the pointer move on.

- Open a dialog, sheet, or page only on a press or Enter.
- Give hover content no required action inside it.

**Picture:** Do: Hover shows a light hint. The page stays usable. Don't: Hover opens a dialog that covers the page.

## Tooltips {#s12-2}

### 12.6 Name every icon-only button with a tooltip  {#name-every-icon-only-button-with-a-tooltip}

Default · Desktop only

**Rule:** Give every icon-only toolbar button a tooltip with its name, on hover and on keyboard focus.

**Applies with:** Hover, Keyboard

**Why:** An icon alone does not say what it does.  **When not:** A button with a visible text label needs no tooltip.

- Use a name of 1 to 5 words: Copy link.
- Show the shortcut in the tooltip when the action has one.
- Same name for screen readers ([Rule 15.11](https://www.designguide.dev/r/give-every-control-a-unique-name.md)). Phone: text ([Rule 4.10](https://www.designguide.dev/r/label-a-valuable-feature-with-a-word.md)).

**Picture:** Do: Hover or focus shows the button's name. Don't: Five icons give no names.

**See:** [15.11 Give every control a unique name](https://www.designguide.dev/r/give-every-control-a-unique-name.md), [4.10 Label a valuable feature with a word](https://www.designguide.dev/r/label-a-valuable-feature-with-a-word.md)

### 12.7 Add the shortcut and never repeat the label  {#add-the-shortcut-and-never-repeat-the-label}

Default · Desktop only

**Rule:** Write the action name and then its shortcut in a tooltip, and never repeat a label that is visible.

**Applies with:** Hover, Keyboard

**Why:** A tooltip is where people learn keys, and a copy of the visible label adds nothing.

- Keep the tooltip text under 75 characters.
- Show the keys of the person's platform.
- Put a menu hint at the row end, not in the label.

**Picture:** Do: The tip adds the key. The label shows once. Don't: The tip repeats the label on the button.

### 12.8 Time the tooltip  {#time-the-tooltip}

Default · Desktop only

**Rule:** Open a tooltip at 600 ms on hover and at once on keyboard focus, and open the next one at once.

**Applies with:** Hover, Keyboard

**Why:** A delay stops hint flashes as the pointer crosses, but keyboard focus needs the hint now.

- Close the tooltip when the pointer or focus leaves.
- Let Esc close it, and keep it open under the pointer.

| Input | Opens | Closes |
| --- | --- | --- |
| Pointer hover | After 600 ms | When the pointer leaves, or on Esc |
| Keyboard focus | At once | When focus leaves, or on Esc |
| Next tooltip in the same toolbar | At once | Same as the first |

## Pointer targets and cursors {#s12-3}

### 12.9 Size targets by input  {#size-targets-by-input}

Default · Desktop only

**Rule:** Make pointer targets at least 24 by 24 px with space between small ones, and size touch targets by [Rule 15.1](https://www.designguide.dev/r/size-targets-by-input-type.md).

**Applies with:** Fine pointer

**Why:** Small and close targets cause wrong presses, which cost more than the room they save.  **When not:** A link inside a sentence can be smaller than 24 by 24.

- Leave a free 24 px circle around a target under 24.
- Let toolbar neighbors' hit areas touch, so the hover fill holds.

**Picture:** Do: Each button has its own roomy target. Don't: The buttons are small and packed.

**See:** [15.1 Size targets by input type](https://www.designguide.dev/r/size-targets-by-input-type.md)

### 12.10 Show the cursor that names the action  {#show-the-cursor-that-names-the-action}

Default · Desktop only

**Rule:** Change the cursor to match the action: text over text, a hand over a link, grab, resize, and an arrow elsewhere.

**Applies with:** Fine pointer

**Why:** The cursor tells a person what a click or a drag will do before it happens.

- Over a button, follow the platform: arrow or hand.
- Show a not-allowed cursor over an invalid drop target.
- Keep custom cursors simple, with no text next to the pointer.

**Picture:** Figure: Each cursor fits its part: I-beam, grab, resize, hand, and arrow.

### 12.11 Give a handle a 10 px hit area  {#give-a-handle-a-10-px-hit-area}

Default · Desktop only

**Rule:** Draw a resize handle as a thin line with a hit area at least 10 px wide for a fine pointer.

**Applies with:** Fine pointer

**Why:** A 1 px line is hard to hit, so widen it and thicken it on drag.  **When not:** A fine pointer needs 10 px, not 24 px, as the handle spans the pane ([Rule 15.1](https://www.designguide.dev/r/size-targets-by-input-type.md)).

- Set a minimum and a maximum width for each pane.
- Make the hit area 44 px wide where touch can reach it.
- Arrow keys move it. Enter or a double click collapses the pane.

**Picture:** Figure: The handle gets thicker while the person drags it, and the cursor shows resize.

**See:** [15.1 Size targets by input type](https://www.designguide.dev/r/size-targets-by-input-type.md)

## Context menus {#s12-4}

### 12.12 Keep every command in the visible interface  {#keep-every-command-in-the-visible-interface}

Hard

**Rule:** Make every context-menu command also available in a visible place, such as a toolbar or a menu.

**Why:** A secondary-button menu is hidden, and a touch screen has no secondary button.

- Use the same name and the same icon in both places.
- Give the keyboard a way to open the menu too ([Rule 12.14](https://www.designguide.dev/r/open-the-same-menu-on-touch-and-keyboard.md)).
- If one row has a context menu, give every such row one.

**Picture:** Figure: Copy, Rename, and Delete sit in the toolbar and in the menu.

**See:** [12.14 Open the same menu on touch and keyboard](https://www.designguide.dev/r/open-the-same-menu-on-touch-and-keyboard.md)

### 12.13 Fit the menu to the item  {#fit-the-menu-to-the-item}

Default

**Rule:** List only commands that fit the item under the pointer, most used first, with Delete last.

**Why:** People read from the end nearest the pointer, so a short menu puts the likely command there.

- Hold at most 12 items in 3 groups, with one submenu level.
- Flip the order when the menu opens upward, keeping the first item nearest.
- Add a title only when it helps, such as 3 items selected.

**Picture:** Do: Four commands for the file. Delete comes last. Don't: Delete comes first. Two unrelated commands are added.

### 12.14 Open the same menu on touch and keyboard  {#open-the-same-menu-on-touch-and-keyboard}

Default · Adapts

**Rule:** Open the same commands from a More button or a long press, so touch reaches every command.

**Wide screen:** On a wide screen, also open the menu on a right-click and on the platform's context-menu key. (Triggers: Fine pointer, Keyboard)

**Why:** One menu with several doors serves a finger, a mouse, and a keyboard alike.

- Use one menu for every door, never two lists that drift apart.
- Show a visible More button, since right-click and long press hide.
- On a phone, show the commands as a bottom sheet.

**Picture:** Size pair (Phone, 375; Window, 1280): The phone shows the commands in a sheet. The window shows them at the pointer.

## Keyboard {#s12-5}

### 12.15 Make every action work with the keyboard  {#make-every-action-work-with-the-keyboard}

Hard

**Rule:** Make every action reachable with the keyboard alone, and let Enter or Space run the focused control.

**Why:** People who cannot use a pointer need the same power, and fast workers prefer keys.

- Focus ring: [Rule 15.12](https://www.designguide.dev/r/show-a-visible-focus-ring.md). Focus placement: [Rule 15.13](https://www.designguide.dev/r/place-focus-on-purpose.md).
- Group related controls into one Tab stop with arrow keys inside.
- Test each flow once with the keyboard alone.

**Picture:** Figure: Tab moves the focus ring. Enter runs the focused button.

**See:** [15.12 Show a visible focus ring](https://www.designguide.dev/r/show-a-visible-focus-ring.md), [15.13 Place focus on purpose](https://www.designguide.dev/r/place-focus-on-purpose.md)

### 12.16 Order Tab by the visual order  {#order-tab-by-the-visual-order}

Default

**Rule:** Make Tab follow the visual order, pane by pane: navigation first, then the list, then the detail.

**Why:** A person who sees the screen expects focus to move the way the eye moves.

- Put a label before its field in the order.
- Never use a positive tab index to reorder focus.
- Offer a skip link to the main area.

**Picture:** Figure: Focus visits the navigation, then the list, then the detail.

### 12.17 Give a key that cycles the panes  {#give-a-key-that-cycles-the-panes}

Default · Desktop only

**Rule:** Give one key that cycles focus between panes: the platform's key, or a free key in a web app.

**Applies with:** Keyboard, Width 840+

**Why:** Tabbing 200 rows to reach the detail pane is too slow, but a pane key takes one press.

- Example: Alt J goes to the next pane, Alt Shift J back.
- Show a focused pane with a ring or a bolder header.
- A phone has one pane, so no pane key ([Rule 15.30](https://www.designguide.dev/r/name-each-pane-as-a-landmark.md)).

**Picture:** Figure: An example key moves focus between panes. Focus is in the list.

**See:** [15.30 Name each pane as a landmark](https://www.designguide.dev/r/name-each-pane-as-a-landmark.md)

### 12.18 Let Enter confirm and Esc close a layer  {#let-enter-confirm-and-esc-close-a-layer}

Default

**Rule:** Let Enter run the default action, and let Esc cancel or close only the top layer.

**Why:** An Esc that closes the wrong layer, or none, traps a person who uses the keyboard.

- Close a popover before the dialog under it.
- Let Esc clear a typed search first, then close the layer.
- Keep a draft when Esc closes a form ([Rule 13.13](https://www.designguide.dev/r/protect-unsaved-work-on-close-and-reload.md)).

**Picture:** Figure: Esc closes the popover only. The page and the focus ring stay.

**See:** [13.13 Protect unsaved work on close and reload](https://www.designguide.dev/r/protect-unsaved-work-on-close-and-reload.md)

## Shortcuts {#s12-6}

### 12.19 Use the platform's standard shortcut  {#use-the-platforms-standard-shortcut}

Default · Desktop only

**Rule:** Use the platform's standard shortcut for undo, redo, cut, copy, paste, select all, and save, and give them no other job.

**Applies with:** Keyboard

**Why:** A key with a new job causes errors and lost work.

- Write the main modifier for the person's platform: Ctrl or Cmd.
- Follow the platform for Redo, Find, Quit, and any key not listed.
- Add custom keys only for the few most frequent actions ([Rule 11.2](https://www.designguide.dev/r/give-frequent-actions-a-keyboard-path.md)).

| Action | Key |
| --- | --- |
| Undo | Ctrl or Cmd Z |
| Redo | The platform's Redo key |
| Cut, copy, paste | Ctrl or Cmd X, C, V |
| Select all | Ctrl or Cmd A |
| Save | Ctrl or Cmd S |
| Find | The platform's Find key. A web app leaves it to the browser |

**See:** [11.2 Give frequent actions a keyboard path](https://www.designguide.dev/r/give-frequent-actions-a-keyboard-path.md)

### 12.20 Show shortcuts where people look  {#show-shortcuts-where-people-look}

Default · Desktop only

**Rule:** Show each shortcut in its menu item and tooltip, and open a shortcut list from a menu item and the platform's key.

**Applies with:** Keyboard

**Why:** People learn a key where they look for the command.

- Show the keys of the person's platform, in key caps.
- Group the list by task, not by key.
- Remove the hint of a shortcut turned off ([Rule 12.21](https://www.designguide.dev/r/keep-bare-single-keys-inside-their-component.md)).

**Picture:** Figure: The list groups keys by task, and rows show key caps.

**See:** [12.21 Keep bare single keys inside their component](https://www.designguide.dev/r/keep-bare-single-keys-inside-their-component.md)

### 12.21 Keep bare single keys inside their component  {#keep-bare-single-keys-inside-their-component}

Hard · Desktop only

**Rule:** Fire a single-key shortcut only while its component has focus, or let the person turn it off or remap it.

**Applies with:** Keyboard

**Why:** Speech input and screen readers send stray letters, and a global key changes work silently.

- Prefer Ctrl or Cmd with a key for page-wide actions.
- Add a setting that turns single-key shortcuts off.
- Change the shortcut list when a key is off.

**Picture:** Figure: J and K act inside the list only, and a switch turns them off.

### 12.22 Leave reserved keys alone  {#leave-reserved-keys-alone}

Hard · Desktop only

**Rule:** Never take a key that the browser, the system, or an assistive tool owns.

**Applies with:** Keyboard

**Why:** A taken key blocks a system function, or traps a person who relies on an assistive tool.  **When not:** A frequent app action can take a rare browser key if the browser action has another path.

- Leave Ctrl or Cmd with W, T, N, L, R to the browser.
- Never take Alt+Tab, Ctrl+Tab, or Shift+Tab for a new job.
- Test each new shortcut in every browser and system you support.

| Keys | Owner |
| --- | --- |
| Ctrl or Cmd with W, T, N, L, and R | The browser |
| Alt, Ctrl, or Shift with Tab | Focus and the system |
| Alt with a function key | The system |
| A single letter outside a field | Speech input, see [Rule 12.21](https://www.designguide.dev/r/keep-bare-single-keys-inside-their-component.md) |

**See:** [12.21 Keep bare single keys inside their component](https://www.designguide.dev/r/keep-bare-single-keys-inside-their-component.md)

### 12.23 Keep a visible control for every shortcut  {#keep-a-visible-control-for-every-shortcut}

Hard · Desktop only

**Rule:** Add a visible control for every shortcut, so a shortcut is a faster way and never the only way.

**Applies with:** Keyboard

**Why:** Some people cannot press key chords, and some devices have no keyboard.

- Plan each action 3 ways: control, shortcut, command ([Rule 12.24](https://www.designguide.dev/r/open-the-command-menu-with-one-key.md)).
- Avoid a shortcut for a rare or destructive action.

**Picture:** Do: The button works for everyone. The key is faster. Don't: Only the key logs a workout. The button is gone.

**See:** [12.24 Open the command menu with one key](https://www.designguide.dev/r/open-the-command-menu-with-one-key.md)

## Command menu {#s12-7}

### 12.24 Open the command menu with one key  {#open-the-command-menu-with-one-key}

Default · Desktop only

**Rule:** Open a command menu with one shortcut from anywhere, and list every action with its shortcut.

**Applies with:** Keyboard

**Why:** A search finds any action by name, and the key beside it teaches the shortcut.

- Use the same shortcut to close it, and restore focus.
- Register a command for every feature, beside its control and key.
- On a phone, show Search and a visible menu ([Rule 4.12](https://www.designguide.dev/r/put-search-above-what-it-searches.md)).

**Picture:** Figure: The menu lists actions, shows their keys, and runs one on Enter.

**See:** [4.12 Put search above what it searches](https://www.designguide.dev/r/put-search-above-what-it-searches.md)

### 12.25 Search by verb and item, rank by use  {#search-by-verb-and-item-rank-by-use}

Default · Desktop only

**Rule:** Match text and synonyms, put the best match on top, and then show recent and in-context commands.

**Applies with:** Keyboard

**Why:** A synonym match and a fitting order get people to the command in one or two keys.

- Show the matched synonym by the real name: Mark done (Archive).
- Disable a command that cannot run now. Omit one that never applies.
- Let Backspace on an empty search go back one level.

**Picture:** Figure: A top result comes first, then recent and in-view commands.

## Selection {#s12-8}

### 12.26 Select rows with a checkbox or with modifiers  {#select-rows-with-a-checkbox-or-with-modifiers}

Default · Adapts

**Rule:** On touch, use a select mode with a checkbox on each row, and show how many rows are selected.

**Wide screen:** On a wide screen, follow the platform: click selects, the toggle key adds a row, Shift selects a range. (Triggers: Fine pointer, Keyboard, Dense data)

**Why:** A checkbox gives touch the file-manager model, and a count shows what the next action changes.

- Let Ctrl or Cmd with A select all filtered rows.
- Select no row when the list opens.
- Bulk actions show only after a selection ([Rule 11.1](https://www.designguide.dev/r/show-bulk-actions-when-rows-are-selected.md)).

**Picture:** Size pair (Phone, 375; Window, 1280): Both select with checkboxes. The window adds hints for Ctrl and Shift in its status bar.

**See:** [11.1 Show bulk actions when rows are selected](https://www.designguide.dev/r/show-bulk-actions-when-rows-are-selected.md)

### 12.27 Keep the selection through scroll and filter  {#keep-the-selection-through-scroll-and-filter}

Default

**Rule:** Keep the selection when the list scrolls or sorts, apply select all to the filtered rows only, and clear it with Esc.

**Why:** Losing rows on scroll, or selecting hidden rows, causes a wrong bulk action.

- Use a header checkbox with three states: none, some, and all.
- Show a selected row with a fill and bold weight, not color alone.
- Show the count in a bar that stays in view.

**Picture:** Figure: Three rows stay selected under the Open filter, with a count bar.

## Drag and drop with a pointer {#s12-9}

### 12.28 Show the drag and where it will land  {#show-the-drag-and-where-it-will-land}

Default · Desktop only

**Rule:** Start a drag after about 3 px of movement, show a ghost, and show where the item will land.

**Applies with:** Fine pointer

**Why:** A click must stay a click, and a ghost and drop line show the result before release.

- Use a visible grip, or the whole row if it has no control.
- Highlight a valid target only while the item is over it.
- Scroll the list near an edge. Touch drag: [Rule 15.15](https://www.designguide.dev/r/give-every-drag-a-non-drag-path.md).

**Picture:** Figure: A ghost follows the pointer, and a line shows the drop place.

**See:** [15.15 Give every drag a non-drag path](https://www.designguide.dev/r/give-every-drag-a-non-drag-path.md)

### 12.29 Give every drag a key path and undo  {#give-every-drag-a-key-path-and-undo}

Default

**Rule:** Let Space pick up an item, arrows move it, Space drop it, Esc cancel, and let the person undo a drop.

**Why:** A drag-only move locks out keyboard users, and a confirm on every drop gets ignored.

- [Rule 15.15](https://www.designguide.dev/r/give-every-drag-a-non-drag-path.md) holds the rule for a non-drag path.
- Ask first only for a drop that undo cannot reverse.
- Keep the dropped item selected after the drop.

**Picture:** Figure: Keys lift, move, and drop a row. A toast offers Undo after the drop.

**See:** [15.15 Give every drag a non-drag path](https://www.designguide.dev/r/give-every-drag-a-non-drag-path.md)
