CommandMenu
A command palette component that provides fast, keyboard-driven search across all bookmarks. Built with cmdk.Props
This component has no props. It manages its own internal state and reads from the BookmarkStore.Usage
Features
- Keyboard Shortcut: Opens with
⌘K(Mac) orCtrl+K(Windows/Linux) - Multi-field Search: Searches across title, URL, and tags simultaneously
- Empty State: Helpful message when no results match the search
- Loading State: Shows loading indicator while fetching bookmarks
- Favicon Display: Shows website icon for each bookmark
- Fallback Handling: Gracefully handles missing favicons
Keyboard Shortcuts
Open/Close
Open/Close
⌘K/Ctrl+K: Toggle command menuEsc: Close the menu
Navigation
Navigation
Search
Search
- Type to filter bookmarks
- Click “Clear search” button or clear input to see all bookmarks
Search Behavior
The command menu searches through:- Bookmark titles
- Full URLs
- All associated tags
Example Interaction
Internal Components
CommandMenuFooter
Displays keyboard shortcuts at the bottom of the menu. This is an internal component that cannot be used separately. Shortcuts displayed:↑↓to navigate↩to openescto close
State Management
The component maintains the following internal state:open: Boolean controlling menu visibilitysearch: Current search input value
bookmarks: Array of all bookmarksloading: Loading state for bookmarks
Accessibility
- Fully keyboard accessible
- ARIA labels for screen readers
- Focus management on open/close
- Modal behavior prevents interaction with background content