@dnd-kit/accessibility
A generic toolkit to help with accessibility
This package has a good security score with no known vulnerabilities.
Community Reviews
Essential but narrow-focused accessibility layer for dnd-kit
The TypeScript support is solid with proper type exports for announcement configurations. However, the documentation assumes familiarity with dnd-kit's broader ecosystem - you won't find standalone guides here. Most developers will copy-paste the announcements object from examples and customize text strings, which works fine but feels somewhat boilerplate-heavy.
The actual accessibility improvements are meaningful and work reliably across screen readers. Custom announcement hooks like `useDndMonitor` let you intercept drag events and provide contextual feedback. The main friction point is that it's not always obvious what announcements are needed for your specific use case without testing with actual screen readers.
Best for: Projects using dnd-kit that need to meet WCAG compliance for drag-and-drop interactions.
Avoid if: You're not using dnd-kit or need accessibility tooling for non-drag-and-drop interactions.
Solid accessibility layer for drag-and-drop, minimal security surface
The library follows secure-by-default principles reasonably well. It sanitizes announced text by rendering to DOM elements rather than using innerHTML, which prevents XSS injection through announcement strings. Error handling is straightforward - it fails gracefully if the DOM isn't available (SSR contexts), though errors could be more informative during development. Input validation is minimal but appropriate for its scope; it expects well-formed configuration objects and doesn't do deep validation, which could lead to runtime errors if you pass malformed data.
Dependency-wise, it has zero external dependencies beyond React peer deps, which significantly reduces supply chain risk. The maintainer has a consistent release history with security-conscious updates. TLS/crypto isn't applicable here. The main security consideration is ensuring your announcement strings don't contain user-generated content without proper sanitization upstream.
Best for: Projects using @dnd-kit that need WCAG-compliant drag-and-drop with minimal security overhead.
Avoid if: You need standalone accessibility utilities outside the @dnd-kit ecosystem or require extensive input validation frameworks.
Solid accessibility layer for dnd-kit with minimal runtime overhead
The `DndContext` integration is straightforward via the `announcements` prop. You provide functions that return strings for different drag states (onDragStart, onDragOver, onDragEnd), and the library handles the live region updates. The `hiddenTextAnnouncer` and `screenReaderInstructions` helpers work out of the box with sensible defaults, though you'll want to customize them for domain-specific language.
One gotcha: the announcement timing can feel laggy under heavy load since it relies on React's render cycle. There's no batching or debouncing built-in, so rapid state changes can queue up announcements. The API is stable across versions, and error handling is passive - invalid configurations simply fall back to no announcements rather than throwing. Documentation assumes familiarity with ARIA patterns, which can be a hurdle initially.
Best for: Projects using @dnd-kit/core that need compliant screen reader support with minimal performance impact.
Avoid if: You need highly customized keyboard navigation beyond standard drag-and-drop patterns or require announcement queuing logic.
Sign in to write a review
Sign In