Skip to main content
NeuralUIv1.15.1New
GitHub
Component

Command Palette

Global command palette with fuzzy search, keyboard shortcuts and service-driven command registration

TypeScript
import {
  NeuCommandPaletteComponent,
  NeuCommandPaletteService,
} from '@neural-ui/core/command-palette';
๐Ÿ  Go to HomeG H
๐Ÿ“– Open Documentation
๐ŸŒ‘ Switch to dark theme
โ˜€๏ธ Switch to light theme
๐Ÿ”” Send test notification
TypeScript
import { NeuCommandPaletteComponent } from '@neural-ui/core/command-palette';
import { NeuCommandPaletteService } from '@neural-ui/core/command-palette';

// 1. Place the component once in the root layout:
// <neu-command-palette />

// 2. Register commands from any component:
@Component({ ... })
export class MyFeatureComponent implements OnInit, OnDestroy {
  private readonly _palette = inject(NeuCommandPaletteService);

  ngOnInit() {
    this._palette.register({
      id: 'my.save',
      label: 'Save changes',
      group: 'Editing',
      shortcut: 'โŒ˜S',
      action: () => this.save()
    });
  }

  ngOnDestroy() {
    this._palette.unregister('my.save');
  }
}