{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "overlay",
  "status": "alpha",
  "import": "@senvenli/react/overlay",
  "genui": {
    "expose": false
  },
  "name": "menu",
  "title": "Menu",
  "exports": [
    "Menu",
    "MenuItem",
    "MenuSection",
    "MenuSubmenu",
    "MenuSeparator"
  ],
  "description": "A list of actions under a button, with sections, icons, shortcuts and disabled items that say why.",
  "keywords": [
    "actions",
    "compound",
    "dropdown",
    "kebab",
    "menu",
    "more"
  ],
  "usage": {
    "when": [
      "Several actions for one object that don't all fit as buttons."
    ],
    "instead": [
      {
        "use": "context-menu",
        "when": "The actions belong to what is under the pointer."
      },
      {
        "use": "select",
        "when": "People pick a value, not run an action."
      },
      {
        "use": "button-group",
        "when": "Two or three actions that fit as visible buttons."
      }
    ]
  },
  "guidance": [
    {
      "rule": "Items are verbs; a disabled item says why."
    }
  ],
  "a11y": {
    "keyboard": [
      {
        "keys": "Arrow keys",
        "does": "Moves between items."
      },
      {
        "keys": "Typing",
        "does": "Jumps to an item."
      },
      {
        "keys": "Home, End",
        "does": "Goes to the first or last item."
      }
    ],
    "builtIn": [
      "Announced as a menu button and menu."
    ],
    "youProvide": [
      "A name for an icon-only menu button.",
      "With children: a textValue on a MenuItem whose label is not plain text, so typing can jump to it; the destructive item last, after a MenuSeparator."
    ]
  },
  "related": [
    "popover",
    "button"
  ],
  "source": [
    "src/overlay/floating.tsx"
  ],
  "props": {
    "Menu": [
      {
        "name": "trigger",
        "type": "ReactElement<unknown, string | JSXElementConstructor<any>>",
        "required": true,
        "origin": "own",
        "description": "The pressable that opens it: the row \"…\" button, the account button."
      },
      {
        "name": "items",
        "type": "readonly MenuEntry[]",
        "required": false,
        "origin": "own",
        "description": "Items, or sections of items with a title. Leave it out to compose the menu as children instead."
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "With no `items`: `MenuItem`, `MenuSection`, `MenuSubmenu` and `MenuSeparator`, in the order given (put the\ndestructive item last yourself; with `items` the menu moves it there)."
      },
      {
        "name": "onAction",
        "type": "(id: Key) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "disabledKeys",
        "type": "Iterable<Key>",
        "required": false,
        "origin": "own"
      },
      {
        "name": "placement",
        "type": "Placement",
        "required": false,
        "origin": "own",
        "description": "\"bottom end\" by default: under the trigger, aligned to its inline end, as row menus sit.",
        "schema": {
          "type": "string",
          "enum": [
            "top",
            "bottom",
            "left",
            "right",
            "start",
            "end",
            "bottom left",
            "bottom right",
            "bottom start",
            "bottom end",
            "top left",
            "top right",
            "top start",
            "top end",
            "left top",
            "left bottom",
            "start top",
            "start bottom",
            "right top",
            "right bottom",
            "end top",
            "end bottom"
          ]
        }
      },
      {
        "name": "selectionMode",
        "type": "\"none\" | \"single\" | \"multiple\"",
        "required": false,
        "origin": "own",
        "description": "For menus that also hold a choice (a view option): checkmarks on the selected items.",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "single",
            "multiple"
          ]
        }
      },
      {
        "name": "selectedKeys",
        "type": "Iterable<Key>",
        "required": false,
        "origin": "own"
      },
      {
        "name": "defaultSelectedKeys",
        "type": "Iterable<Key>",
        "required": false,
        "origin": "own"
      },
      {
        "name": "onSelectionChange",
        "type": "(keys: Selection) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "isOpen",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "onOpenChange",
        "type": "(isOpen: boolean) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "aria-label",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Names the menu when the trigger's own name is not enough.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "motion",
        "type": "ComponentMotion",
        "required": false,
        "origin": "own",
        "description": "`auto` (follow the device), `reduce` or `none`, for this component; the provider's setting otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "reduce"
          ]
        }
      }
    ],
    "MenuItem": [
      {
        "name": "id",
        "type": "Key",
        "required": true,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own",
        "description": "The label: a verb (\"Edit\"). It may hold more than text (an avatar, two lines); then give `textValue`."
      },
      {
        "name": "textValue",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "The words typing jumps to; the label itself when it is plain text.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "icon",
        "type": "IconName",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string",
          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
        }
      },
      {
        "name": "shortcut",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Shown in mono at the end (\"E\").",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "isDisabled",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "tone",
        "type": "\"danger\"",
        "required": false,
        "origin": "own",
        "description": "`danger` for the destructive action; put it last, after a `MenuSeparator`.",
        "schema": {
          "type": "string",
          "enum": [
            "danger"
          ]
        }
      },
      {
        "name": "href",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Makes the item a link; it goes through the host router.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "lang",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "The language of the label, when it differs from the page.",
        "schema": {
          "type": "string"
        }
      }
    ],
    "MenuSection": [
      {
        "name": "id",
        "type": "Key",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "title",
        "type": "string",
        "required": true,
        "origin": "own",
        "description": "The section's title (\"Share\"); it names the group.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own",
        "description": "`MenuItem`s and `MenuSubmenu`s."
      }
    ],
    "MenuSubmenu": [
      {
        "name": "id",
        "type": "Key",
        "required": true,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "lang",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "The language of the label, when it differs from the page.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "isDisabled",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "icon",
        "type": "IconName",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string",
          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
        }
      },
      {
        "name": "shortcut",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Shown in mono at the end (\"E\").",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "label",
        "type": "string",
        "required": true,
        "origin": "own",
        "description": "The item that opens the submenu (\"Move to\").",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own",
        "description": "The submenu's `MenuItem`s."
      }
    ],
    "MenuSeparator": []
  },
  "tokens": [
    "ds-background-neutral-bold",
    "ds-background-neutral-pressed",
    "ds-background-neutral-subtle-hovered",
    "ds-blanket",
    "ds-border",
    "ds-border-focused",
    "ds-easing-enter",
    "ds-easing-exit",
    "ds-icon-danger",
    "ds-icon-subtle",
    "ds-radius-large",
    "ds-radius-small",
    "ds-radius-xlarge",
    "ds-shadow-overlay",
    "ds-space-050",
    "ds-space-075",
    "ds-space-100",
    "ds-space-150",
    "ds-space-200",
    "ds-space-300",
    "ds-surface-overlay",
    "ds-text",
    "ds-text-danger",
    "ds-text-disabled",
    "ds-text-inverse",
    "ds-text-subtle",
    "ds-text-subtlest",
    "font-ds-mono"
  ],
  "strings": [],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
