Skip to main content

CommandMenu

A searchable command palette for quick navigation and action execution. Includes CommandMenuItem for individual actions and CommandShortcut for keyboard shortcut badges.

Import​

import { CommandMenu, CommandMenuItem, CommandShortcut } from '@scaffald/ui';

Usage​

CommandMenu renders as a modal overlay triggered by a keyboard shortcut (Ctrl+K or Cmd+K).

const [isOpen, setIsOpen] = useState(false);

<CommandMenu
open={isOpen}
onClose={() => setIsOpen(false)}
placeholder="Type a command or search..."
>
<CommandMenuItem label="Go to Dashboard" icon="home" />
<CommandMenuItem label="Settings" icon="settings" />
</CommandMenu>

CommandMenuItem​

Live Preview
<ThemeProvider initialTheme="light">
<Stack gap={4} style={{padding: 8, borderRadius: 8, backgroundColor: '#f5f5f5'}}>
  <CommandMenuItem label="Go to Dashboard" />
  <CommandMenuItem label="Search Projects" />
  <CommandMenuItem label="Create New Document" />
  <CommandMenuItem label="Help & Support" />
</Stack>
</ThemeProvider>

CommandShortcut​

Live Preview
<ThemeProvider initialTheme="light">
<Stack gap={12}>
  <Row gap={8} style={{alignItems: 'center'}}>
    <Text style={{width: 120}}>Command Palette</Text>
    <CommandShortcut keys={['Ctrl', 'K']} />
  </Row>
  <Row gap={8} style={{alignItems: 'center'}}>
    <Text style={{width: 120}}>Save</Text>
    <CommandShortcut keys={['Ctrl', 'S']} />
  </Row>
  <Row gap={8} style={{alignItems: 'center'}}>
    <Text style={{width: 120}}>Undo</Text>
    <CommandShortcut keys={['Ctrl', 'Z']} />
  </Row>
</Stack>
</ThemeProvider>

Changelog​

See GitHub Releases for version history.