Astryx

Astryx Command Palette

Component

About

Root component. Manages open state, search, keyboard navigation, and composition slots.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Command Palette to your project and fits it to your theme.

Code

How Astryx Command Palette is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

import {useMemo} from 'react';
import {CommandPalette} from '@/components/ui/astryx-command-palette';
import {createStaticSource} from '@astryxdesign/core/Typeahead';

// Remove isInline for production — command palettes should be modal.
function CommandPaletteShowcase() {
  const source = useMemo(
    () =>
      createStaticSource([
        {id: 'home', label: 'Home'},
        {id: 'settings', label: 'Settings'},
        {id: 'profile', label: 'Profile'},
        {id: 'dashboard', label: 'Dashboard'},
        {id: 'help', label: 'Help'},
      ]),
    [],
  );

  return (
    <CommandPalette
      isOpen
      isInline
      onOpenChange={() => {}}
      searchSource={source}
    />
  );
}

export default function CommandPaletteShowcaseDemo() {
  return (
    <div
      data-astryx-theme="neutral"
      data-theme="light"
      style={{colorScheme: 'light', display: 'contents'}}>
      <CommandPaletteShowcase />
    </div>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    59
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    31
  • Astryx Avatar

    Astryx Avatar

    30
  • Astryx Badge

    Astryx Badge

    29
  • Astryx Button Group

    Astryx Button Group

    27
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    19
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Avatar Group

    Astryx Avatar Group

    9