Birch UI v0.1
Pricing

Keyboard and accessibilityDocument

The keyboard shortcuts of Birch UI Document Editor, the toolbar and dialog patterns, screen-reader support, right-to-left text and translating the interface.

Open .md

Every command works from the keyboard, and the shortcuts follow Microsoft Word. On macOS use Cmd where the table says Ctrl. The first table below is also exported as SHORTCUTS, so you can show it in your own help screen; the second table is not part of that export.

Shortcuts#

Keys Action
Ctrl+B, I, U Bold, italic, underline
Ctrl+Shift+X Strikethrough
Ctrl+= / Ctrl+Shift+= Subscript / superscript
Ctrl+] / Ctrl+[ Grow / shrink the font
Ctrl+Space Clear formatting
Ctrl+Alt+1 … 6 Heading 1 to 6
Ctrl+Shift+N Normal style
Ctrl+L, E, R, J Align left, centre, right, justify
Ctrl+1, 5, 2 Single, 1.5 and double line spacing
Ctrl+M / Ctrl+Shift+M Increase / decrease indent
Ctrl+Shift+L Bulleted list
Ctrl+Shift+7 Numbered list
Tab / Shift+Tab Demote / promote a list item, next / previous table cell, otherwise a tab character
Ctrl+K Insert or edit a link
Ctrl+Enter Page break
Shift+Enter Line break
Ctrl+Alt+M New comment
Ctrl+Shift+E Track changes on or off
Ctrl+F / Ctrl+H Find / replace
Enter, Shift+Enter in the find bar Next / previous match
Ctrl+Z / Ctrl+Y Undo / redo
Ctrl+P Print the document
Escape in focus mode Leave focus mode; the Exit focus mode button at the top of the window does the same
Shift+F10 or the context menu key Context menu
Alt+F10 Move focus to the ribbon (or the classic toolbar)
F6 / Shift+F6 Move between the document, the mini toolbar, the ribbon, the ruler and open panes
Alt Show ribbon key tips; type the letters shown to pick a tab and then a command
Alt+Q Search commands
Ctrl+F1 Collapse or expand the ribbon
Shift+F3 Cycle the case of the selection or the word at the cursor
Escape Close the find bar, cancel the format painter, close menus and dialogs

More Word shortcuts#

Keys Action
Ctrl+Shift+> / Ctrl+Shift+< Grow / shrink the font
Ctrl+Shift+A All capitals
Ctrl+D Font dialog
Ctrl+Shift+D / Ctrl+Shift+K / Ctrl+Shift+H Double underline / small capitals / hidden text
Ctrl+Space Remove character formatting
Shift+F1 Reveal formatting pane
Ctrl+Alt+V Paste special. Right after a paste it switches the format of that paste
Ctrl+Alt+C, then Ctrl+Alt+V on a selection Copy formatting, then paste it onto the selection
Ctrl+0 Add or remove 12 pt of space before the paragraph
Ctrl+T / Ctrl+Shift+T Increase / reduce the hanging indent
Ctrl+Q Remove paragraph formatting
Ctrl+Shift+8 Show or hide formatting marks
Ctrl+Shift+Space Non-breaking space
Ctrl+Shift+- Non-breaking hyphen
Ctrl+- Optional hyphen
Ctrl+Alt+- Em dash
Ctrl+Alt+. Ellipsis
Ctrl+Shift+Enter Column break
Ctrl+Delete Delete the next word
Ctrl+Alt+F / Ctrl+Alt+D Insert a footnote / an endnote
Alt+Shift+D Insert the date
Alt+Shift+Left / Alt+Shift+Right Promote / demote a heading
Alt+Shift+Up / Alt+Shift+Down Move the paragraph up / down
Alt+Home / Alt+End First / last cell in the row
Alt+PageUp / Alt+PageDown First / last cell in the column
Ctrl+Shift+S Styles pane
Ctrl+Shift+G Word count
Ctrl+G or F5 Navigation pane
Ctrl+Shift+F9 Remove a link
F9 / Alt+F9 Update fields / show field codes
F7 Check spelling (with a spellcheck function)
Ctrl+Alt+Shift+S Save a version

Shortcuts added for Google Docs users#

Keys Action
Ctrl+Shift+V Paste as plain text. The paste options button still offers the other formats
Ctrl+. / Ctrl+, Superscript / subscript
Ctrl+\ Clear formatting
Alt+Shift+5 Strikethrough
Ctrl+Alt+0 Normal text
Ctrl+Alt+H Highlight on or off
Ctrl+Alt+Shift+H Version history
Ctrl+/ Keyboard shortcuts dialog
Ctrl+O / Ctrl+S Open a file / save

Keys the browser keeps#

A web page cannot take every key combination. In Chrome and Firefox on Windows and Linux the browser handles these itself and the editor never receives them:

  • Ctrl+T opens a tab, so the hanging indent shortcut does not work, and Ctrl+Shift+T reopens a closed tab.
  • Ctrl+Shift+N opens a private window, so the Normal style shortcut does not work.
  • Ctrl+N and Ctrl+W open a window and close the tab. The editor does not bind them.

These combinations reach the editor only where the host does not claim them: an embedded web view, an installed app window or a kiosk shell. Other shortcuts can be taken by the operating system or a browser extension in the same way. Every command behind a shortcut is also on the ribbon and available through exec, so offer those where the keys are not available: exec('paragraphStyle', 'Normal'), and exec('paragraphFormat', { indentLeft, indentFirstLine }) for the hanging indent.

Because Tab inserts a tab in the document, as in every word processor, use Alt+F10 to reach the toolbar and Shift+Tab from the toolbar to return to elements before the editor.

Word and Google Docs shortcuts side by side#

The common shortcuts of both products, and what each does here. "Kept by the browser" means that Chrome and Firefox act on the key themselves and a web page never receives it; see Keys the browser keeps.

Action Word Google Docs In the editor
Bold, italic, underline Ctrl+B, Ctrl+I, Ctrl+U same Works
Strikethrough Ctrl+Shift+X (web: Alt+Shift+5) Alt+Shift+5 Works, both
Superscript, subscript Ctrl+Shift+=, Ctrl+= Ctrl+., Ctrl+, Works, both sets
Clear formatting Ctrl+Space Ctrl+\ Works, both
Grow, shrink font Ctrl+Shift+>, Ctrl+Shift+<; Ctrl+], Ctrl+[ Ctrl+Shift+., Ctrl+Shift+, Works
Highlight Ctrl+Alt+H none Works
Heading 1 to 6 Ctrl+Alt+1 … 6 same Works
Normal text Ctrl+Shift+N Ctrl+Alt+0 Ctrl+Alt+0 works; Ctrl+Shift+N is kept by the browser
Align left, centre, right, justify Ctrl+L, E, R, J Ctrl+Shift+L, E, R, J Word's keys work. The Google Docs keys are not bound: with Ctrl+Shift they are Word's bulleted list and Track changes, and the browser reloads on Ctrl+Shift+R
Line spacing 1, 1.5, 2 Ctrl+1, 5, 2 none Works
Bulleted list, numbered list Ctrl+Shift+L, none Ctrl+Shift+8, Ctrl+Shift+7 Ctrl+Shift+L and Ctrl+Shift+7 work; Ctrl+Shift+8 shows formatting marks, as in Word
Indent, outdent Ctrl+M, Ctrl+Shift+M Ctrl+], Ctrl+[ Word's keys work; the bracket keys change the font size, as in Word
Undo, redo Ctrl+Z, Ctrl+Y same, and Ctrl+Shift+Z Works, all three
Cut, copy, paste Ctrl+X, C, V same Works
Paste as plain text Ctrl+Shift+V same Works
Paste special Ctrl+Alt+V none Works
Copy and paste formatting Ctrl+Shift+C, Ctrl+Shift+V Ctrl+Alt+C, Ctrl+Alt+V The Ctrl+Alt pair works; Ctrl+Shift+C is kept by the browser
Select all Ctrl+A same Works
Find, replace Ctrl+F, Ctrl+H same Works
Go to, navigation Ctrl+G, F5 none Works: opens the Navigation pane
Insert link Ctrl+K same Works
Page break, column break, line break Ctrl+Enter, Ctrl+Shift+Enter, Shift+Enter Ctrl+Enter, none, Shift+Enter Works
New comment Ctrl+Alt+M same Works
Track changes (suggesting) Ctrl+Shift+E Ctrl+Alt+Shift+Z Word's key works
Footnote, endnote Ctrl+Alt+F, Ctrl+Alt+D Ctrl+Alt+F, none Works
Word count Ctrl+Shift+G Ctrl+Shift+C Word's key works; Ctrl+Shift+C is kept by the browser
Version history none Ctrl+Alt+Shift+H Works
Font dialog Ctrl+D none Works
Open, save, print Ctrl+O, Ctrl+S, Ctrl+P same Works
New document Ctrl+N none Kept by the browser. Use File, New
Shortcut list none Ctrl+/ Works
Search the commands Alt+Q Alt+/ Alt+Q works
Delete the previous or next word Ctrl+Backspace, Ctrl+Delete same Works
Start or end of the document Ctrl+Home, Ctrl+End same Works
Move a paragraph up or down Alt+Shift+Up, Alt+Shift+Down same Works
Hanging indent Ctrl+T, Ctrl+Shift+T none Kept by the browser. Use the Paragraph dialog or the ruler
Check spelling F7 Ctrl+Alt+X F7 works with a spellcheck function

Ctrl+/ opens the Keyboard shortcuts dialog, which lists every shortcut of the editor in the language of the interface: the general ones first, then those of each ribbon tab, with a search box that matches names and keys. It is also on the File tab and in the command search, and exec('keyboardShortcuts') opens it from code.

Structure#

  • The editing surface is a role="textbox" with aria-multiline="true" and the label from ariaLabel (default "Document"). Headings are real h1–h6 elements, lists are ul and ol, and tables are table elements, so screen readers' navigation commands work inside the document.
  • The ribbon uses the WAI-ARIA tabs pattern for its tabs (Left, Right, Home and End switch tabs, Down enters the commands) and the toolbar pattern for the commands of a tab: one tab stop, arrow keys with a roving tabindex, Up returns to the tab and Escape returns to the document. Split buttons expose the main action and the menu as two buttons, galleries are groups of toggle buttons, and groups that do not fit collapse into a labelled menu button.
  • The ruler's tab stops and margin boundaries are sliders too: arrow keys move them, Delete removes a tab stop and Enter opens the Tabs dialog. Everything the ruler does is also available in the Paragraph, Tabs and Page setup dialogs.
  • The classic toolbar (ribbon: false) follows the WAI-ARIA toolbar pattern: one tab stop, arrow keys, Home and End move between controls, toggles report aria-pressed, menus report aria-haspopup and aria-expanded, and unavailable commands stay focusable with aria-disabled. Items that do not fit move into a More tools menu.
  • The Search commands box is a role="combobox" that controls a role="listbox"; the highlighted option is exposed with aria-activedescendant, so focus stays in the box while the arrow keys move through the list.
  • Menus use role="menu" with arrow-key navigation, and dialogs are modal with a focus trap; Escape returns focus to where it was.
  • The ruler's indent markers are sliders with their value announced in centimetres or inches.
  • Header and footer areas are buttons that open their editor with Enter.
  • A polite live region announces tracking on and off, page count changes, find results, replacements and new comments. It also announces the formatting at the cursor when it changes, the page and section when the cursor moves to another one, and the tracked change or comment the cursor enters; see Accessibility.
  • Comments, tracked changes and find matches never rely on colour alone: changes are underlined or struck through, comments are underlined, and the current match is outlined.
  • Motion is disabled when the user prefers reduced motion. In forced-colours mode pressed buttons are filled with the highlight colour, the selected ribbon tab is boxed, focus has its own outline, and comments, selected cells, dialogs and the page keep a visible edge.

Right-to-left text#

Set rtl: true, or put the editor in an element with dir="rtl", to mirror the interface. Individual paragraphs can be right-to-left with exec('textDirection', 'rtl'); they export to Word with w:bidi. The ruler and list indents follow the paragraph direction.

Translating the interface#

Every string goes through the shared Birch UI translator. Pass localeText with the keys you want to change, or set them once for every component with setDefaultLocaleText from @birchui/core:

TypeScript
createDocumentEditor(host, {
  localeText: {
    'document.bold': 'Fett',
    'document.italic': 'Kursiv',
    'document.pageOf': 'Seite {page} von {pages}',
    'document.wordCount': '{count} Wörter',
    'document.trackChanges': 'Änderungen nachverfolgen',
  },
});

Keys start with document.; the API page lists the most used ones.

The shortcut list as data#

WORD_SHORTCUTS is the list of the Word shortcuts the editor adds on top of the basic ones, with the keys and an English label for each. Use it to build a help panel of your own.

TypeScript
import { WORD_SHORTCUTS } from '@birchui/document';

for (const { keys, label } of WORD_SHORTCUTS) console.info(`${keys}: ${label}`);

↑ ↓ to move, Enter to open, Esc to close