Accessibility

How zinejs handles reduced motion, focus, and built-in controls.

Keyboard

The container is made focusable ( tabindex="0" unless you already set one) and labelled as a flipbook. With the book focused:

  • Arrow keys turn a page in reading order (RTL swaps left and right).
  • Home and End jump to the first and last page.
  • An aria-live region announces the current page.

Reduced motion

zinejs listens to prefers-reduced-motion: reduce (via matchMedia). When that preference is on:

  • Page turns use the bundled simple curl (flat spine rotation), even if you configured another curl.
  • Flip timing uses a short fixed duration and ignores the configured flipDuration.
  • Motion is reduced, not removed. The reader still gets a clear direction cue for the turn.

Built-in controls CSS also gates some decorative transitions behind prefers-reduced-motion: no-preference, so those animations stay off when the user prefers less motion. Discoverability hints skip their motion cues under the same preference.

To try it: enable “reduce motion” in the OS or browser, then flip pages in any example.

Built-in controls and dialogs

When you enable the optional controls UI, zinejs ships patterns aimed at keyboard and assistive tech:

  • Toolbar and buttons use roles and aria-label text (prev/next, zoom, share, and so on).
  • Focusable controls show a visible :focus-visible outline.
  • The share dialog is a modal (role="dialog", aria-modal), traps focus while open, closes on Escape, and restores focus on close.
  • Side panels (thumbnails, outline, search) use listbox/option patterns, close on Escape, and restore focus.

See Options for enabling and positioning controls, and the API for programmatic navigation if you build your own chrome.