ngx-command-palette
An accessible ⌘K / Ctrl+K command palette for Angular, built the Angular way: standalone components, signals, zoneless-ready and no dependencies besides Angular (and tslib, see below).

Live demo →
Unlike headless kits such as @ngxpert/cmdk / @ngneat/cmdk, it is a complete palette: register commands as plain objects and drop one <rr-command-palette /> in your app; the dialog, the shortcut, fuzzy search, async results and accessibility are built in. Coming from cmdk? See the migration guide.
Using an AI coding assistant? Point it to llms.txt: the whole API and setup in one compact file (also shipped in the npm package).

Features
- Opens with ⌘K / Ctrl+K (configurable, multiple shortcuts allowed), closes with Esc or a click outside
- Fuzzy search with highlighted matches, case and accent insensitive, smart ranking (word starts, consecutive letters)
- Commands grouped in sections, with optional icon, description, shortcut hint and extra keywords
- Each command either navigates to a route or runs a function; optionally built from your router configuration
- Optional Recent section, stored in
localStorage
- Async providers (e.g. customer search on your API) with debounce, loading state and request cancellation
- Register commands from any component with signals; they are removed automatically when the component is destroyed
- Full keyboard navigation: ↑ ↓, Home / End, Enter, Ctrl+N / Ctrl+P
- Accessible: dialog + combobox/listbox pattern,
aria-activedescendant, focus trap, focus restore, live region, prefers-reduced-motion
- Themeable with CSS variables (
--rr-cp-*), light and dark themes, no Tailwind required
- Custom templates for items and the empty state
- No browser globals at import time (SSR friendly), works with or without zone.js
| Light |
Dark |
 |
 |
Installation
ng add @rrstudioapps/ngx-command-palette
The schematic installs the package, adds provideCommandPalette() to your application config and
<rr-command-palette /> (with CommandPaletteComponent in imports) to the root component. It asks two
questions, and the defaults keep the library's own behavior:
| Option |
Default |
Effect |
routes |
false |
true writes provideCommandPalette({ routes: true }) (a command per route). |
shortcut |
'mod+k' |
Written to the provider only when you choose a different one. |
project |
default |
The application to set up in a workspace with several (--project <name>). |
It is safe to run again: nothing that is already there is added twice. For an NgModule-based app, or a root
component it cannot edit safely, it changes nothing and prints the two manual steps below.
Manual installation. Without the schematic:
npm install @rrstudioapps/ngx-command-palette
then follow the Quick start.
Requires Angular 21 or 22 (@angular/core, @angular/common, @angular/router).
Dependencies. The library has no runtime dependency besides Angular, with one exception: tslib, the small helper library that the Angular package format (ng-packagr) requires for every Angular library. Angular itself depends on it, so it is already in your node_modules and adds nothing to your install. No rxjs, no polyfills, nothing else.
Quick start (5 minutes)
ng add does steps 1 and 2 (without the example commands). 1. Configure it (optional: without this call the defaults are used).
// app.config.ts
import { provideCommandPalette } from '@rrstudioapps/ngx-command-palette';
export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes), provideCommandPalette({ shortcut: 'mod+k' })],
};
2. Place the palette once and register some commands.
// app.ts
import { Component, inject } from '@angular/core';
import { CommandPaletteComponent, injectCommands } from '@rrstudioapps/ngx-command-palette';
@Component({
selector: 'app-root',
imports: [CommandPaletteComponent, RouterOutlet],
template: `
<router-outlet />
<rr-command-palette />
`,
})
export class App {
private auth = inject(AuthService);
constructor() {
injectCommands([
{ id: 'home', label: 'Home', group: 'Navigation', route: '/' },
{
id: 'settings',
label: 'Settings',
group: 'Navigation',
route: '/settings',
keywords: ['preferences'],
},
{ id: 'logout', label: 'Log out', icon: '🚪', run: () => this.auth.logout() },
]);
}
}
3. Press ⌘K / Ctrl+K. That's it.
4. Add page commands from any component. They exist only while the component is alive.
Pass a signal to keep them in sync with your state:
@Component({/* … */})
export class ProjectsPage {
projects = signal<Project[]>([]);
constructor() {
injectCommands(
computed(() => [
{ id: 'project-new', label: 'New project', group: 'Projects', run: () => this.create() },
...this.projects().map((p) => ({
id: `project-${p.id}`,
label: `Open ${p.name}`,
group: 'Projects',
route: ['/projects', p.id],
})),
]),
);
}
}
5. Search your API with an async provider:
injectCommandProvider({
id: 'customers',
group: 'Customers',
minQueryLength: 2,
search: async (query, signal) => {
const res = await fetch(`/api/customers?q=${encodeURIComponent(query)}`, { signal });
const customers: Customer[] = await res.json();
return customers.map((c) => ({
id: `customer-${c.id}`,
label: c.name,
description: c.email,
route: ['/customers', c.id],
}));
},
});
search can also return an Observable (e.g. from HttpClient): anything with a subscribe method works.
API
provideCommandPalette(options?)