Installation
Usage
Props
Array of action items to display in the dropdown. Each action has:
id(string): Unique identifierlabel(string): Action display texticon(ReactNode): Icon componentdescription(string, optional): Secondary textshort(string, optional): Keyboard shortcut displayend(string, optional): Right-aligned metadata
Whether the dropdown should be open by default
Action Interface
Features
- Live Search: Real-time filtering as you type with 200ms debounce
- Keyboard Navigation: Use Arrow keys to navigate, Enter to select, Escape to close
- Smart Filtering: Searches across both label and description fields
- Smooth Animations: Staggered animations for dropdown items
- Accessible: Full ARIA support with combobox pattern
- Visual Feedback: Icon transitions between search and send states
Keyboard Shortcuts
| Key | Action |
|---|---|
↓ | Navigate to next item |
↑ | Navigate to previous item |
Enter | Select highlighted item |
Escape | Close dropdown |
Customization
The component uses a debounced search with 200ms delay. Results update automatically as the user types, filtering actions by matching text in the label or description. The dropdown displays helpful hints at the bottom:- “Press ⌘K to open commands”
- “ESC to cancel”
Dependencies
lucide-react- Icon componentsmotion(Framer Motion) - Animation libraryreact- Core React library@/components/ui/input- shadcn/ui Input component@/hooks/use-debounce- Debounce hook for search optimization