Documentation Index
Fetch the complete documentation index at: https://docs.cedarcopilot.com/llms.txt
Use this file to discover all available pages before exploring further.
CommandBar Component
TheCommandBar component provides a powerful command palette interface with keyboard navigation, hotkey support, and customizable styling. It features intelligent search filtering, priority-based sorting, and support for both regular and fixed bottom groups.
Features
- Keyboard Navigation: Full arrow key navigation and Enter to select
- Hotkey Support: Register activation events for individual commands
- Intelligent Search: Custom search functions with priority scoring
- Color Variants: Multiple color schemes for visual categorization
- Fixed Bottom Group: Persistent commands that stay visible during scrolling
- Cedar Editor Integration: Uses Cedar’s rich text editor for input
- Context Badges: Shows selected context with the integrated ContextBadgeRow
- Spell System: Automatic hotkey registration using Cedar’s spell system
Import
Basic Usage
Advanced Usage
With Color Variants and Priority Scoring
With Controlled Collapse State
Props
CommandBarProps
Whether the command bar is visible
Command bar contents organized into groups
Placeholder text for the search input
Additional CSS classes for the container
Callback when the command bar should close
Whether the command bar is in collapsed state (only shows search bar)
Callback when search text changes
CommandBarItem
Unique identifier for the item
Display text for the item
Callback when item is selected
Optional description text shown below the label
Optional icon (emoji string or React component)
Optional hotkey for triggering this command
How the hotkey should behave (TRIGGER, HOLD, TOGGLE)
Whether the item is disabled
Color variant for styling (‘blue’, ‘green’, ‘purple’, ‘orange’, ‘pink’,
‘amber’, ‘red’, ‘indigo’, ‘white’)
Custom function to determine if item matches search text
Function to score items for better ordering (higher scores appear first)
Whether to ignore hotkey when typing in input elements (auto-determined by
default)
CommandBarGroup
Unique identifier for the group
Items in this group
Optional heading text for the group
CommandBarContents
Array of command groups
Optional group that stays at the bottom outside scroll area
Color Variants
The CommandBar supports the following color variants for visual categorization:blue- Blue theme with hover statesgreen- Green theme for success/create actionspurple- Purple theme for special featuresorange- Orange theme for warningspink- Pink theme for favorites/highlightsamber- Amber theme for pending statesred- Red theme for destructive actionsindigo- Indigo theme for navigationwhite- Clean white theme
Keyboard Shortcuts
- ⌘K - Toggle focus between input and command list
- Escape - Unfocus input or close command bar
- Arrow Keys - Navigate through commands
- Enter - Execute selected command
- Tab - Focus the search input
Integration with Cedar
The CommandBar automatically integrates with Cedar’s spell system to register hotkeys and uses the Cedar editor for rich text input with context support.Spell Registration
EachCommandBarItem with an activationEvent automatically registers a spell that:
- Respects the
activationModesetting - Only triggers when the command bar is open
- Automatically closes the command bar after execution
- Handles input element detection based on modifier keys
Context Integration
The integratedContextBadgeRow shows selected context from Cedar’s agent input context system, allowing users to see and manage their current context selection.
Examples
File Manager Command Bar
Search-Focused Command Bar
Styling
The CommandBar uses Tailwind CSS classes and supports dark mode. Color variants are implemented using opacity-based backgrounds that work well in both light and dark themes. Custom styling can be applied through theclassName prop or by overriding the default Tailwind classes.
