Paleta de comandos
Paleta global de comandos con búsqueda fuzzy, atajos de teclado y registro de acciones vía servicio
TypeScript
import {
NeuCommandPaletteComponent,
NeuCommandPaletteService,
} from '@neural-ui/core/command-palette';Abrir paleta
Comandos registrados en esta demo
🏠 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');
}
}