Command Palette Patterns
Keyboard-driven command palettes for quick navigation, search, and actions using the cmdk library.
What's Included#
- Basic command palette with Cmd+K/Ctrl+K keyboard shortcut trigger
- Grouped commands for navigation, actions, and quick access
- Async search with debounced input and loading indicators
- Recent items history with localStorage persistence
- Styled command palette with polished animations and keyboard hints
Usage#
Via CLI#
Loading code block...
Via AI Assistant#
Ask your AI assistant:
- "Use the command palette pattern from Bootspring"
- "Apply the Bootspring command palette pattern to my project"
Key Considerations#
- Use Cmd+K (Mac) / Ctrl+K (Windows) as the standard keyboard trigger
- Display keyboard hints (Enter to select, Escape to close) for discoverability
- Debounce search input to prevent excessive API calls during typing
- Group related commands by category for better scannability
- Track and display recent items to help users quickly repeat actions
Related Patterns#
- Navigation - Navigation patterns
- Dropdowns - Dropdown menu patterns
- Modals - Modal dialog patterns