Accessibility
Folio's documents app (FolioApp, folio-react, the plugin-* UIs) and its presentation layer (SlidesApp, the viewer, the slide show, presenter view, recordings, folio-reader) aim at WCAG 2.2 AA. This page says what hosts get for free, what to keep when composing their own shells, and how their own buttons get tooltips and shortcuts. The shared helpers live in @nextgensoftwares/folio-a11y (framework-free; folio-react re-exports them).
What hosts get
Tooltips. Every icon-only control (toolbar and ribbon buttons, panel controls, thumbnails, status bar, menus, presenter and show controls, reader toolbar, comments, collaborators) shows its name and key on hover and on keyboard focus, after a short delay, placed to stay on screen, in the host's theme and direction. Esc dismisses it; it stays while the pointer is over it; it's tied to the control with aria-describedby, and the key is also aria-keyshortcuts. Keys read the platform's way (⌘B on Apple platforms, Ctrl+B elsewhere) and come from the keymaps: the editor's DEFAULT_KEYS, the host's and plugins' keymap (FolioEditor.keyBindings), the deck's keymap for slides (deckItemShortcut).
Keyboard.
| Where | Keys |
|---|---|
| First Tab | "Skip to content" moves focus to the document or slide |
| Toolbars, ribbon, galleries, lists, thumbnails | one Tab stop each; arrows move (mirrored right to left), Home / End |
| Ribbon tabs, inspector tabs | arrows switch tabs |
| Menus, popovers, dropdowns | opened from the keyboard they take focus and give it back on close; Esc closes; dialogs keep Tab inside |
| Document editor | Tab types a tab (as in Word): Esc, then Tab leaves the editor |
| Slide editor | Tab / Shift+Tab select the next / previous shape (announced: ""Quarterly results" selected, 2 of 6"), past the last one Tab moves on; arrows move it 1 px (Shift: 10 px), announced with its position; Enter edits its text; Delete removes it; Esc deselects |
| Slide list | ↑ / ↓ change slide (focus follows), Delete, Ctrl+D, Ctrl+M |
| Slide show | → / Space next, ← back, number + Enter jumps, B / W black / white, Ctrl+P pen, Ctrl+L laser, Esc ends; Alt+F5 presenter view |
Screen readers.
- Slides drawn on canvases (the show, the presenter view, replays, read-only surfaces) carry a text alternative (
SlideText): a "Slide 3 of 10: Title" heading, then the slide's text, its pictures' alternative text and its tables, in reading order (the slide's shape order, as in PowerPoint). Slide changes are announced. - In the editor, the slide surface is named "Slide 3 of 10", text is real text, pictures are images named by their alternative text (the shape's description), shapes without text but with a description are images too, and decoration is hidden.
- Status changes are spoken through one live region (
announce): save status, collaborators joining and leaving, going offline and coming back, shape moves. - Watermarks are visual only (
aria-hidden).
Visual. Focus rings are solid and at least 3:1 against every surface; text tokens are 4.5:1 or more in light and dark (muted text included); form field borders are 3:1 (--folio-field-border); controls are at least 24 px; prefers-reduced-motion turns off UI motion (panels, popovers, tooltips, drawers), and slide-show animations follow it by default (motionUiPlugin({ motion: 'system' | 'full' | 'reduced' })). Layouts reflow at 200% zoom (narrow and phone sizes collapse the panels into drawers).
Composing your own shell
SlidesRoot, FolioApp's pieces and the slides building blocks keep these properties as long as you keep a few things:
- Render toolbars with folio-react's
Toolbar(roving focus) or putuseRovingFocus(ref)/ref={rovingRef()}on your own groups. - Use
ToolButton(or<Tooltip label shortcut>) for icon buttons, never a baretitle:titleis mouse-only and invisible to many screen readers. - Keep one skip link:
AppShellrenders it (skipLabel); in a custom layout, link to the element markeddata-skip-target(the editor's input). - Put
SlideTextnext to any canvas you draw a slide on (SlideCanvaswithoutlabelis hidden from assistive technology). - Name pages:
FolioView pageName={(page) => …}. - Under
setFolioUnstyled, bring a visible:focus-visiblestyle and keep the.folio-skip,.folio-tooltipand live-region classes visible to assistive technology (the live region andSlideTexthide themselves with inline styles, not CSS). - Give the page one
<h1>(your app's): Folio's surfaces don't add one, since they usually sit inside a host page.
Tooltips and shortcuts for your own items
Items get tooltips from their label and shortcut, so plugins don't do anything extra:
// Documents (UIItem): label required, shortcut optional. A command item
// without `shortcut` shows the key its command is bound to in the keymap.
{ id: 'my.highlight', label: 'Highlight', icon: 'highlight', group: 'format', kind: 'command', run: toggleHighlight }
// Slides (DeckUIItem): the key bound to the item's command (and args) in the
// deck's keymap, else `shortcut`.
{ id: 'my.stamp', label: 'Stamp', icon: 'stamp', group: 'insert', command: 'my.stamp', shortcut: 'Mod-Shift-s' }For your own React controls:
import { Tooltip, tooltipProps } from '@nextgensoftwares/folio-react';
<Tooltip label="Share" shortcut="Mod-Shift-e"><button aria-label="Share" onClick={share}><ShareIcon /></button></Tooltip>
<button aria-label="Export" {...tooltipProps('Export', 'Mod-e')}><ExportIcon /></button>Shortcuts are written ProseMirror-style (Mod-b, Shift-Mod-z, Alt-ArrowUp): formatShortcut shows them per platform and ariaShortcut gives the aria-keyshortcuts value.
Checking
node tools/a11y/axe.mjs [url]: axe-core (WCAG 2.2 A/AA and best practices) on the docs app, the slides app, both embed examples, the reader, the slide show and the presenter view, in Chromium and WebKit; fails on any serious or critical violation.node tools/a11y/keyboard.mjs [url]: keyboard-only walkthroughs of each app (skip link, editor in and out, toolbars, slide list, ribbon, show, reader find, presenter view), checking where focus lands and that a ring shows.