๐ฏ Keyboard Navigation Guide
August 31, 2025 ยท View on GitHub
Complete keyboard accessibility implementation for the Omarchy Theme Builder.
๐ Overview
The Omarchy Theme Builder features comprehensive keyboard navigation support, making it fully accessible to users who prefer or require keyboard interaction. This implementation follows WCAG 2.1 AA guidelines and provides an intuitive, efficient navigation experience.
๐ Quick Start
- Enable Keyboard Mode: Press
Tabto automatically enable keyboard navigation mode - Open Help: Press
?orHto view all available keyboard shortcuts - Navigate: Use
TabandShift+Tabto move between focusable elements - Activate: Press
EnterorSpaceto activate buttons and controls
โจ๏ธ Global Keyboard Shortcuts
Navigation
| Key Combination | Action |
|---|---|
Tab | Move to next focusable element |
Shift + Tab | Move to previous focusable element |
Enter | Activate focused element |
Space | Activate button or toggle |
Escape | Close modal/dialog or collapse panel |
Theme Controls
| Key | Action |
|---|---|
T | Toggle theme controls panel |
E | Export current theme |
R | Reset theme to default |
โ / โ | Navigate between theme presets |
Quick Theme Access
| Key | Theme |
|---|---|
1 | Rose Pine |
2 | Catppuccin |
3 | Nord |
4 | Tokyo Night |
5 | Everforest |
6 | Gruvbox |
7 | Kanagawa |
Help & Information
| Key | Action |
|---|---|
? or H | Toggle keyboard shortcuts help modal |
๐จ Theme Controls Navigation
Panel Controls
- Toggle Panel: Press
Tor click the theme controls button - Navigate Within Panel: Use
Tabto move between controls - Close Panel: Press
Escapeor click outside
Color Customization
- Open Color Picker: Press
EnterorSpaceon any color swatch - Navigate Colors: Use
Tabto move between color options - Quick Color Access: Press the letter shortcut for each color:
B- BackgroundF- ForegroundS- SurfaceA- AccentL- Love (Error)G- Gold (Warning)O- Foam (Success)I- Iris (Primary)P- Pine (Info)R- Rose (Secondary)
Color Picker Modal
- Navigate:
Tabbetween color picker and hex input - Confirm:
Enteron "Done" button - Cancel:
EscapeorEnteron "Cancel" button - Focus Trap: Focus stays within the modal while open
Theme Presets
- Navigate Presets: Use
Tabto move between preset buttons - Apply Preset: Press
EnterorSpaceon focused preset - Quick Access: Use number keys
1-7for instant preset application - Navigate with Arrows: Use
โandโto cycle through presets
๐ฅ๏ธ Desktop Simulation Navigation
Top Panel
- Application Menu:
Tabto focus,Enterto activate - Workspaces:
Tabto navigate,Enterto switch - Quick Launch:
Tabthrough app icons,Enterto launch - System Indicators:
Tabto focus,Enterfor settings
Window Management
- Navigate Windows: Use
Tabto move focus between simulated windows - Window Controls: Access minimize, maximize, close with
Tab+Enter
๐ง Accessibility Features
Focus Management
- Visual Focus Indicators: Clear outlines show focused elements
- Focus Trapping: Modals trap focus within their boundaries
- Focus Restoration: Focus returns to trigger element when modals close
- Skip Links: Quick navigation to main content areas
Screen Reader Support
- ARIA Labels: Comprehensive labeling for all interactive elements
- Live Regions: Announces status changes and notifications
- Semantic Markup: Proper heading structure and landmarks
- Alt Text: Descriptive text for all visual elements
High Contrast Support
- Enhanced Focus: Stronger outlines in high contrast mode
- Color Independence: Navigation works without color perception
- Reduced Motion: Respects user's motion preferences
๐ฏ Testing Your Navigation
Visit /keyboard-test to access the comprehensive keyboard navigation test suite:
- Automated Testing: Interactions automatically mark tests as passed
- Progress Tracking: Visual progress bar shows completion status
- Test Categories:
- Tab navigation
- Focus trapping
- Keyboard shortcuts
- Modal interactions
- Skip links functionality
Test Instructions
- Navigate to the test page
- Press
Tabto enable keyboard mode - Use various keyboard shortcuts and navigation
- Watch tests automatically pass as you interact
- Check the results section for completion status
๐ ๏ธ Implementation Details
Architecture
src/lib/stores/keyboard.js # Keyboard navigation state management
src/lib/components/
โโโ KeyboardHelpModal.svelte # Help modal with shortcuts
โโโ ThemeControls.svelte # Enhanced with keyboard support
โโโ TopPanel.svelte # Keyboard-accessible system panel
โโโ Desktop.svelte # Main container with global handlers
Key Features
- Focus Manager: Centralized focus state management
- Keyboard Handler: Unified shortcut processing
- Focus Trapping: Modal focus containment
- Announcement System: Screen reader notifications
- Mode Detection: Automatic keyboard/mouse mode switching
Browser Compatibility
- Modern Browsers: Full support in Chrome, Firefox, Safari, Edge
- Focus-Visible: Polyfill included for older browsers
- Screen Readers: Tested with NVDA, JAWS, VoiceOver
๐จ Customization
Styling
Focus indicators and keyboard navigation styles are defined in src/app.css:
.keyboard-modeclass applied when keyboard navigation is active- Focus styles use CSS custom properties for theming
- High contrast mode support included
Adding New Shortcuts
- Add shortcut definition to
shortcutsobject inkeyboard.js - Handle the shortcut in relevant component's keyboard handler
- Update help modal with new shortcut documentation
- Add appropriate ARIA labels and descriptions
Custom Focus Behavior
Use the FocusManager class to implement custom focus behavior:
import { focusManager } from '$lib/stores/keyboard.js';
// Focus first element in container
focusManager.focusFirst(containerElement);
// Set up focus trap for modal
const trap = focusManager.setupFocusTrap(modalElement);
๐ Troubleshooting
Common Issues
- Focus Not Visible: Ensure
keyboard-modeclass is applied to body - Shortcuts Not Working: Check for input field focus preventing shortcuts
- Focus Trap Issues: Verify modal has focusable elements
- Screen Reader Problems: Check ARIA labels and live regions
Debug Mode
Add ?debug=keyboard to URL for enhanced keyboard navigation logging.
๐ค Contributing
When adding new interactive elements:
- Ensure proper
tabindexvalues - Add appropriate ARIA labels and descriptions
- Include keyboard event handlers for
EnterandSpace - Test with screen readers
- Update keyboard shortcuts help modal if adding new shortcuts
Testing Checklist
- Tab navigation works in logical order
- All interactive elements are keyboard accessible
- Focus indicators are clearly visible
- Screen reader announces changes properly
- Shortcuts work as expected
- Focus trapping works in modals
- High contrast mode supported
๐ Resources
๐ Changelog
v1.0.0 - Initial Implementation
- Complete keyboard navigation system
- Focus management and trapping
- Keyboard shortcuts for all major functions
- Screen reader support with ARIA labels
- High contrast and reduced motion support
- Comprehensive test suite
Made accessible with โค๏ธ for the Omarchy community
For issues or suggestions, please visit our GitHub repository!