{
 "id": "command-menu",
 "name": "Command menu",
 "purpose": "A search-first menu for every action and page, grouped, with keyboard shortcuts, live filtering and an empty result that says what to try.",
 "use_when": [
  "as the keyboard-first way to reach any page or action in a work app",
  "a jump-to search over pages and records in a tool with many screens, opened from a shortcut"
 ],
 "avoid_when": [
  "a few actions on one item: use action-menu",
  "the main navigation people see all the time: use sidebar-nav",
  "asking an assistant a free question: use ai-composer"
 ],
 "type": "navigation",
 "style": "technical",
 "width": "medium",
 "tags": {
  "audience": "work",
  "industries": [
   "devtools",
   "saas",
   "productivity"
  ],
  "keywords": [
   "command palette",
   "search",
   "keyboard",
   "shortcuts",
   "cmd k"
  ]
 },
 "root": ".odl-command-menu",
 "parts": [
  {
   "name": "search",
   "selector": ".odl-search input",
   "what": "the filter box with its placeholder",
   "slot": "input"
  },
  {
   "name": "groups",
   "selector": ".odl-group",
   "what": "a group heading such as Actions or Go to",
   "slot": "list"
  },
  {
   "name": "options",
   "selector": "[role=\"option\"]",
   "what": "one command: icon, label, optional count and shortcut",
   "slot": "list"
  },
  {
   "name": "empty",
   "selector": ".odl-empty",
   "what": "the line shown when nothing matches",
   "slot": "text"
  },
  {
   "name": "footer",
   "selector": "footer",
   "what": "key hints for move, open and close",
   "slot": "none"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "groups"
  ],
  "properties": {
   "placeholder": {
    "type": "string",
    "maxLength": 40,
    "part": "search"
   },
   "groups": {
    "type": "array",
    "minItems": 1,
    "maxItems": 4,
    "part": "groups",
    "items": {
     "type": "object",
     "required": [
      "label",
      "options"
     ],
     "properties": {
      "label": {
       "type": "string",
       "maxLength": 20
      },
      "options": {
       "type": "array",
       "minItems": 1,
       "maxItems": 8,
       "items": {
        "type": "object",
        "required": [
         "label"
        ],
        "properties": {
         "label": {
          "type": "string",
          "maxLength": 36
         },
         "icon": {
          "type": "string",
          "maxLength": 32
         },
         "meta": {
          "type": "string",
          "maxLength": 16
         },
         "shortcut": {
          "type": "string",
          "maxLength": 6
         }
        }
       }
      }
     }
    }
   },
   "empty": {
    "type": "string",
    "maxLength": 60,
    "part": "empty"
   }
  }
 },
 "states": {
  "shown": [
   "active option",
   "hover",
   "filtered",
   "no results"
  ],
  "edge": {
   "empty": {
    "status": "shown",
    "how": "when nothing matches, groups hide and a line says what to try",
    "evidence": "No commands match. Try a shorter word."
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if search fails, show the empty line with the error text and a retry hint in place of the options"
   },
   "disabled": {
    "status": "not_built",
    "how": "for a command that cannot run now, set aria-disabled on its option, grey it and skip it with the arrow keys"
   },
   "overflow": {
    "status": "handled",
    "how": "the list has a fixed height of about nine rows and scrolls on its own; arrow keys keep the active option in view",
    "evidence": "overflow-y: auto"
   },
   "long_text": {
    "status": "handled",
    "how": "long command labels are cut with an ellipsis on one line",
    "evidence": "text-overflow: ellipsis; white-space: nowrap"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-icon-default",
  "--ds-color-icon-subtle",
  "--ds-color-surface-overlay",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-elevation-overlay",
  "--ds-font-family-text",
  "--ds-icon-stroke-md",
  "--ds-radius-detail",
  "--ds-radius-nested",
  "--ds-radius-overlay",
  "--ds-size-control-lg",
  "--ds-size-control-md",
  "--ds-size-icon-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-4",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-inset-xs",
  "--ds-space-stack-md",
  "--ds-space-stack-xs",
  "--ds-text-body-lg",
  "--ds-text-body-md",
  "--ds-text-label-md",
  "--ds-text-label-sm"
 ],
 "a11y": {
  "summary": "A combobox with a listbox: arrow keys move the active option through aria-activedescendant, and groups hide when nothing in them matches.",
  "roles": [
   "combobox",
   "contentinfo",
   "dialog",
   "listbox",
   "option"
  ],
  "keyboard": [
   "Typing in the search box filters the commands and hides empty groups",
   "Down and Up arrows move the active option and wrap at the ends; the search box keeps focus",
   "Enter and Esc are shown in the footer but the file does not handle them"
  ],
  "controls": {
   "button": 0,
   "input": 1,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": false,
  "min_target": true
 },
 "files": {
  "html": "components/command-menu/component.html",
  "bytes": 12066,
  "script": true
 },
 "source": "brand/showcase/components/02-command-palette",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/command-menu.html",
  "json": "https://opendesigner.dev/library/command-menu.json",
  "page": "https://opendesigner.dev/library/command-menu/"
 },
 "get": {
  "curl": "curl -fsSLo command-menu.html https://opendesigner.dev/library/command-menu.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add command-menu --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component command-menu to this project: https://opendesigner.dev/library/command-menu.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
