sorta11y
sorta11y is the accessible, dependency-free alternative to drag-and-drop sort libraries. It lets people reorder a vertical list with the keyboard (a screen-reader-safe grab / move / drop model) as well as with the mouse, touch or pen, and announces every change through an ARIA live region.
It progressively enhances a server-rendered <ul><li> list, so it degrades
gracefully and coexists with whatever else is already on the page. No framework,
no jQuery, no build step.
What you get
Section titled “What you get”- Grab · move · drop on the keyboard: Space to pick up, arrows to move, Space to drop, Esc to cancel.
- The same model for a single pointer — drag it, or tap to pick up and tap again to place. That tap path is the WCAG 2.5.7 alternative to dragging.
- One polite live region per instance, pre-inserted so the first announcement is never swallowed.
- Announcements in your own wording — labels are functions, so they interpolate positions and pluralise properly.
- Focus stays put — items are moved, not re-created — so the focused item
keeps focus and it never falls back to
<body>after a reorder. prefers-reduced-motionhonoured: instant reposition instead of a slide.- Zero runtime dependencies and no build step required to use it.
Where to start
Section titled “Where to start”| If you want to… | Go to |
|---|---|
| Get it into your project | Installation |
| See the smallest working example | Quick start |
| Understand the interaction model | Keyboard |
| Know what happens under a screen reader | Accessibility model |
| Look up an option or method | Options |
| Try it before reading anything | Live playground |
Why it exists
Section titled “Why it exists”Popular sort libraries are powerful but not keyboard- or screen-reader-accessible out of the box — SortableJS’s accessibility gap has been an open, frequently requested issue since 2017. sorta11y deliberately trades “do everything” scope for one thing done well: a single vertical list anyone can reorder, including keyboard and screen-reader users.
That focus is the point. If you need nested trees, multi-list transfer or grid reordering, sorta11y is the wrong tool — and says so rather than shipping an inaccessible version of it.