+
+```gjs live preview no-shadow
+import { CommandPalette, Dialog } from "ember-primitives";
+import { fn } from "@ember/helper";
+import { tracked } from "@glimmer/tracking";
+
+const ran = tracked("");
+
+/**
+ * `@onSelect` is handed the entry, so this is both what the row does and
+ * where the dialog closes. `close` is curried in from the block.
+ */
+const run = (close, command) => {
+ ran.value = command.label;
+ close();
+};
+
+const query = tracked("");
+const setQuery = (value) => (query.value = value);
+const matching = (term) =>
+ COMMANDS.filter((command) => command.label.toLowerCase().includes(term.trim().toLowerCase()));
+
+const COMMANDS = [
+ {
+ icon: "📄",
+ label: "New File",
+ description: "Create a file in this folder"
+ },
+ { icon: "📁", label: "New Folder", description: "Create a folder" },
+ {
+ icon: "🔍",
+ label: "Find in Files",
+ description: "Search the whole project"
+ },
+ {
+ icon: "⚙️",
+ label: "Open Settings",
+ description: "Preferences and keybindings"
+ },
+ {
+ icon: "🌓",
+ label: "Toggle Theme",
+ description: "Switch between light and dark"
+ },
+];
+
+
+
+
+ Press Ctrl / ⌘ + K to open it.
+
+ {{#if ran.value}}
+ Ran: {{ran.value}}
+ {{/if}}
+
+
+
+```
+
+
+
+## Without a modal
+
+Leave out the `