Skip to main content
Introducing packages.sweber.dev
Documentation menuAccessibility

Accessibility

What Lagrangian Pro does for keyboard and screen reader users, for reduced motion and for touch, part by part.

Every part works without a pointer and respects prefers-reduced-motion. When the user asks for reduced motion, automatic motion jumps to its end; movement the user makes themselves, such as dragging, still follows the pointer.

PartKeyboardAnnouncements and roles
sheetEscape closesGive the sheet a role and label yourself
drawerEscape closes, focus moves in and backaria-hidden follows the state, give it a role and label yourself
dialogEscape closes, Tab stays inside, focus returnsrole="dialog", aria-modal="true"
popoverEscape closes, focus moves in and backaria-haspopup, aria-expanded on the trigger
carouselArrow keys, Home, Endrole="region" (carousel) with your label, slides as groups with aria-current
sortableSpace picks up, arrows move, Space or Enter drops, Escape cancelsLive region, texts can be translated with messages
boardSame as sortable, also between columnsLive region with the column name, translatable
toastsTimers pause while the stack has focusrole="status", or role="alert" for errors
indicatorUses the buttons you provideYou mark the selected item (aria-selected or aria-current)
zoom+, -, 0 and arrow keys on the focused viewportGive the viewport a label
pullToRefreshProvide a button for the same actionaria-busy while refreshing
fallDecorative, turn it off for reduced motionContent stays in the DOM and in reading order

Things you do

  • Give dialogs, drawers and sheets an accessible name with aria-label or aria-labelledby.
  • Offer a non-gesture way to do what a gesture does: a close button in a sheet, a refresh button next to pull to refresh, arrow buttons next to a carousel.
  • Translate the announcements of sortable and board with the messages option.
  • Keep the focus order of the DOM sensible; Lagrangian never changes it, and it puts the focus back where it was when something closes.