{
  "_copyright": "Copyright (c) 2026, Salesforce, Inc., All rights reserved. For full license text, see the LICENSE.txt file",
  "$schema": "https://slds.lightningdesignsystem.com/schemas/uif-foundation.v1.json",
  "apiVersion": "1.0.0",
  "name": "Menu",
  "description": "Initializes a trigger element around the dropdown",
  "structure": {
    "name": "root",
    "restrict": [
      "div"
    ],
    "description": "Menu trigger container",
    "children": [
      {
        "name": "trigger",
        "restrict": [
          "button"
        ],
        "description": "Menu trigger button",
        "attributes": {
          "static": {
            "aria-haspopup": "menu"
          },
          "bound": {
            "aria-expanded": {
              "prop": "isOpen"
            }
          }
        },
        "children": [
          {
            "name": "triggerIcon",
            "restrict": [
              "svg"
            ],
            "description": "Glyph rendered inside the trigger button",
            "attributes": {
              "static": {
                "aria-hidden": "true"
              }
            }
          },
          {
            "name": "triggerAssistiveText",
            "restrict": [
              "span"
            ],
            "description": "Visually-hidden label for the trigger button"
          }
        ]
      },
      {
        "name": "dropdown",
        "restrict": [
          "div"
        ],
        "description": "Dropdown menu container",
        "renderWhen": "slotFilled",
        "children": [
          {
            "name": "header",
            "restrict": [
              "div"
            ],
            "description": "Optional menu header",
            "renderWhen": "slotFilled",
            "slot": {
              "name": "header"
            }
          },
          {
            "name": "items",
            "restrict": [
              "ul"
            ],
            "description": "Menu items list",
            "attributes": {
              "static": {
                "role": "menu"
              }
            },
            "children": [
              {
                "name": "menuItem",
                "restrict": [
                  "li"
                ],
                "description": "individual menu item",
                "repeats": true,
                "attributes": {
                  "static": {
                    "role": "presentation"
                  }
                },
                "children": [
                  {
                    "name": "menuItemLink",
                    "restrict": [
                      "a"
                    ],
                    "description": "Interactive target inside the menu item. Carries role=menuitem (or menuitemcheckbox when used as a toggle).",
                    "attributes": {
                      "static": {
                        "role": "menuitem"
                      }
                    },
                    "children": [
                      {
                        "name": "menuItemLabel",
                        "restrict": [
                          "span"
                        ],
                        "description": "Truncating label for the menu item's text content"
                      },
                      {
                        "name": "menuItemLeadingIcon",
                        "restrict": [
                          "svg"
                        ],
                        "description": "Optional leading icon rendered before the label"
                      },
                      {
                        "name": "menuItemTrailingIcon",
                        "restrict": [
                          "svg"
                        ],
                        "description": "Optional trailing icon rendered after the label (e.g. submenu indicator or row affordance)"
                      }
                    ]
                  },
                  {
                    "name": "submenu",
                    "restrict": [
                      "div"
                    ],
                    "description": "Nested submenu panel for items that branch into a child menu",
                    "renderWhen": "slotFilled",
                    "slot": {
                      "name": "submenu"
                    }
                  }
                ]
              },
              {
                "name": "separator",
                "restrict": [
                  "li"
                ],
                "description": "visual separator between menu items",
                "attributes": {
                  "static": {
                    "role": "separator"
                  }
                }
              }
            ],
            "slot": {
              "name": "default",
              "required": true
            }
          }
        ]
      }
    ]
  },
  "states": [
    {
      "name": "open",
      "type": "boolean",
      "aria": "aria-expanded",
      "description": "Whether the menu is open"
    },
    {
      "name": "disabled",
      "type": "boolean",
      "aria": "aria-disabled",
      "description": "Whether the menu trigger is disabled"
    },
    {
      "name": "selected",
      "type": "boolean",
      "description": "whether a menu item is selected"
    }
  ],
  "accessibility": {
    "requirements": [
      {
        "id": "menu-role",
        "description": "The items list must carry role='menu' (or role='group' when grouped under a header)"
      },
      {
        "id": "menuitem-role",
        "description": "Menu item links must carry role='menuitem' (or role='menuitemcheckbox' for toggleable items with aria-checked)"
      },
      {
        "id": "keyboard-navigation",
        "description": "Arrow keys should navigate between items, Enter/Space selects"
      },
      {
        "id": "escape-close",
        "description": "Pressing Escape should close the menu"
      },
      {
        "id": "submenu-haspopup",
        "description": "A menu item that opens a submenu must have aria-haspopup='true' and aria-expanded reflecting its open state"
      }
    ]
  }
}
