Skip to content

Accessibility ​

People read and fix documents with a mouse, a finger, the keyboard or a screen reader. PaperPic aims at WCAG 2.2 AA, and most of the work is built in. This page lists what it does and what your app needs to add.

What your app needs to do ​

  • A description. Pass alt, such as "Receipt from 5 November". Screen readers read it as the name of the image.
  • Texts in the user's language. Screen readers announce the buttons and the changes, so translate them with labels.
  • Your own controls, if any. With toolbar: false, the buttons you build replace the built-in ones, and they need their own names and keyboard support.
  • A visible focus. Keep your CSS from hiding the focus outline of the viewer.

Keyboard ​

With the focus inside the viewer:

KeyAction
+ and -Zoom in and out
Arrow keysPan
0Fit the whole image
Ctrl+ZUndo
Ctrl+Shift+Z or Ctrl+YRedo
EnterConfirm the open tool, or else apply the changes
EscLet go of a selected corner, close the open tool, or else cancel the changes

On macOS, Cmd works like Ctrl. With the focus on a button, Enter presses that button instead. Before cancelling changes, Esc asks for confirmation. With toolbar: false, Esc still closes a tool, but it does not cancel the edit: your interface decides.

  • Toolbar and edit bar. Tab reaches each bar, and inside it the arrow keys move between the buttons, with Home and End for the first and the last.
  • Corner handles. With Crop or Straighten open, Tab moves between the handles, and the arrow keys move the focused one 1 screen pixel, or 10 with Shift. Screen readers hear these keys, and that Enter finishes, in the description of each handle.
  • Rulers. The rulers of Adjust and Clean up are native ranges: the arrow keys, Page Up, Page Down, Home and End move them. Enter keeps the value, as Done does, and Esc closes the tool without it.

Screen readers ​

  • The image has the role of an image, named by alt. Without alt, screen readers skip it.
  • The toolbar and the edit bar have their own names, such as "Image controls" and "Editing controls".
  • An announcement reports what the user cannot see by the focus alone: the loading of the image, the zoom level, the start of the edit mode, a document that Straighten finds, a selected corner and the position of a moved corner, the value of a ruler, the result of Apply, and any failure.
  • The finishes of Clean up are buttons that say whether they are pressed. A tool in use, which a dot marks on screen, is described as "In use". In black and white, Adjust is described with the reason it is disabled.

Touch screens ​

  • With any-pointer: coarse, buttons and corner handles measure at least 44 pixels. Any touch screen matches it, also on a laptop with a trackpad.
  • While a finger drags a corner, a magnifier shows the area under it.
  • A corner also moves without dragging: press its handle, and then tap where it goes. This works with a mouse too.
  • While the image is fitted, one finger scrolls the page, so the viewer does not trap people inside it. Once zoomed, it pans the image.

Preferences ​

  • Reduced motion. With prefers-reduced-motion: reduce, the buttons change state without transitions, and the corners go at once to the document that Straighten finds, without sliding.
  • Forced colors. In Windows high contrast and other forced color modes, pressed buttons and the main actions keep a visible outline.
  • Dark mode. The colors follow the color-scheme of your page, which can follow the system. See Styling.

Released under the MIT License.