Accessibility Plugin
TheAccessibility plugin automatically adds ARIA attributes and screen reader announcements to your drag and drop interface:
What the Plugin Provides
The Accessibility plugin automatically adds:ARIA Attributes
role="button"- Identifies draggable elements as interactivearia-roledescription="draggable"- Describes the element’s drag capabilitytabindex="0"- Makes elements keyboard-focusablearia-pressed- Indicates drag state (true when dragging)aria-grabbed- Alternative drag state indicatoraria-disabled- Indicates when dragging is disabledaria-describedby- Links to screen reader instructions
Screen Reader Instructions
Default instructions are automatically provided:“To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel.”
Live Region Announcements
Screen readers announce drag and drop events in real-time:- Drag start: “Picked up draggable item .”
- Drag over: “Draggable item was moved over droppable target .”
- Drag end: “Draggable item was dropped over droppable target .”
- Cancel: “Dragging was cancelled. Draggable item was dropped.”
Keyboard Navigation
The keyboard sensor enables full keyboard control:Default Keyboard Controls
Keyboard Sensor Configuration
Customize keyboard behavior with theKeyboardSensor:
Custom Announcements
Customize screen reader announcements to match your interface:Custom Screen Reader Instructions
Provide context-specific instructions:Focus Management
Ensure proper focus management during drag operations:Preventing Keyboard Activation
Prevent keyboard sensor activation in specific scenarios:Accessible Drag Handles
When using drag handles, ensure they’re properly labeled:Testing Accessibility
Keyboard Testing Checklist
1
Tab Navigation
Verify you can tab to all draggable items
2
Keyboard Dragging
Test dragging with Space/Enter and arrow keys
3
Escape Cancellation
Confirm Escape cancels the drag operation
4
Focus Management
Ensure focus returns to the correct element after drop
Screen Reader Testing
- Test with NVDA (Windows), JAWS (Windows), or VoiceOver (macOS)
- Verify announcements are clear and timely
- Ensure instructions are read when focusing items
- Check that drag state changes are announced
Best Practices
Reduced Motion Support
The library automatically respectsprefers-reduced-motion:
Next Steps
1
Implement Keyboard Support
Add custom keyboard sensors for specialized interactions
2
Optimize Announcements
Tune announcement timing and content for your use case
3
Test with Users
Conduct accessibility testing with real assistive technology users