{
  "componentId": "shadcn:Menubar",
  "projectionState": "Open owned menu, child submenu closed; closed popup is normally unmounted or explicitly hidden under keepMounted.",
  "sourceRule": "Menubar is a native div role=menubar from MenubarPrimitive, default horizontal/modal=true/loopFocus=true, with whole-bar disabled. Each MenubarMenu composes a separate DropdownMenu Root; it owns its own open/onOpenChange lifecycle, not a fabricated Menubar selected-menu prop. Top-level triggers have role=menuitem inside the bar and native activation. Left/Right and Home/End move between top-level triggers according to actual bar orientation; opening a sibling closes the prior menu with sibling-open reason. The observed sibling switch may initially focus the menu surface; Down then highlights its first command. Content composes DropdownMenu with align=start, alignOffset=-4 and sideOffset8. Menubar orientation is actually forwarded, unlike the separate Tabs/ToggleGroup wrapper quirks. All exported wrappers retain exact source types. Menu Item uses div role=menuitem, CheckboxItem role=menuitemcheckbox with boolean checked/defaultChecked and cancellable onCheckedChange, RadioGroup uses role=group with any value/defaultValue and cancellable onValueChange; RadioItem uses menuitemradio. Item closeOnClick defaults true, but CheckboxItem and RadioItem closeOnClick default false in Base UI1.9. Command onClick is the native React/Base UI synthetic handler, not an onValueChange. Its event.preventBaseUIHandler() can prevent remaining internal primitive handling such as default closing; this is distinct from callback eventDetails.cancel() on Root or setting changes. Source useButton makes disabled items focusable in the composite while blocking activation; do not promise they are skipped by arrows. Labels/Groups/Separators supply native primitive relations, and Shortcut is only displayed text: it registers no shortcut. SubmenuRoot/Trigger/Content form an independently owned child menu; Root closeParentOnEsc=false normally limits Escape to the child, while context-menu nested Escape follows its specialized source policy. Canceled callbacks preserve the relevant open/checked/radio state; controlled props remain authoritative. onItemHighlighted reports actual element|undefined and reason/label details. Root open transitions, onOpenChangeComplete and externally deferred unmount are distinct. Positioning, pointer safe zones, typeahead, focus management and automatic sibling closing belong to the primitive.",
  "keyboardAndFocus": "Native trigger Enter/Space or supported opening arrows enter the menu. Within a vertical menu Up/Down, Home/End and label typeahead highlight items; disabled entries may be focused but cannot activate. Enter/Space activate an enabled command or setting. Focus/highlight is not a command commit. Right opens an appropriate submenu and Left returns according to source direction/orientation. Escape dismisses the applicable menu level unless the source change callback is canceled, normally returning to its owning trigger; an outside press/focus transition follows the actual modality and finalFocus policy rather than a universal focus jump. Tab follows the primitive dismissal/focus-manager policy and never becomes a Dialog-style fabricated trap. Menubar parent keyboard navigation is separate from child vertical navigation. Essential instructions and command alternatives stay visible outside hover/long-press alone.",
  "referenceComposition": "<div data-slot=\"menubar\" role=\"menubar\" aria-label=\"Report application\"><button data-slot=\"menubar-trigger\" type=\"button\" id=\"menubar-trigger\" role=\"menuitem\" aria-haspopup=\"menu\" aria-expanded=\"true\" data-popup-open=\"\" aria-controls=\"menubar-popup\">File</button><button data-slot=\"menubar-trigger\" type=\"button\" role=\"menuitem\" aria-haspopup=\"menu\" aria-expanded=\"false\">Edit</button></div><div class=\"cn-menu-target cn-menubar-content\" data-slot=\"menubar-content\" role=\"menu\" id=\"menubar-popup\" aria-label=\"Report actions\" dir=\"ltr\" style=\"--available-width:320px;--available-height:500px\"><div data-slot=\"menubar-group\" role=\"group\" aria-labelledby=\"menubar-label\"><div data-slot=\"menubar-label\" id=\"menubar-label\" data-menu-label>Report</div><div data-slot=\"menubar-item\" role=\"menuitem\" tabindex=\"0\">Save report<span data-slot=\"menubar-shortcut\" data-menu-shortcut aria-hidden=\"true\">⌘S</span></div><div data-slot=\"menubar-item\" role=\"menuitem\" tabindex=\"-1\" aria-disabled=\"true\">Unavailable command</div><div data-slot=\"menubar-item\" role=\"menuitem\" tabindex=\"-1\" data-variant=\"default\">Delete report</div></div><div data-slot=\"menubar-separator\" role=\"separator\"></div><div data-slot=\"menubar-checkbox-item\" role=\"menuitemcheckbox\" tabindex=\"-1\" aria-checked=\"false\"><span class=\"cn-menubar-checkbox-item-indicator\"></span>Show grid</div><div data-slot=\"menubar-radio-group\" role=\"group\" aria-label=\"Report view\"><div data-slot=\"menubar-radio-item\" role=\"menuitemradio\" tabindex=\"-1\" aria-checked=\"true\"><span class=\"cn-menubar-radio-item-indicator\"><span><svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m5 12 4 4 10-10\" fill=\"none\" stroke=\"currentColor\"/></svg></span></span>Compact</div><div data-slot=\"menubar-radio-item\" role=\"menuitemradio\" tabindex=\"-1\" aria-checked=\"false\"><span class=\"cn-menubar-radio-item-indicator\"></span>Comfortable</div></div><div data-slot=\"menubar-sub-trigger\" role=\"menuitem\" tabindex=\"-1\" aria-haspopup=\"menu\" aria-expanded=\"false\">Export formats<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m9 6 6 6-6 6\" fill=\"none\" stroke=\"currentColor\"/></svg></div></div>",
  "protocol": "Each real Menu or Submenu Root is a separate SCXML protocol instance. SOURCE_* events observe actual source callbacks/normalized native transactions, retaining original objects; sends are not additional DOM dispatches. Escape/Tab/typeahead intentions do not themselves invent a command, close or setting change: source callbacks specify the accepted instance transaction. Checkbox/radio controls own independent controlled/cancellation authority. Source animation/focus/deferred-unmount lifecycle stays separate. No blanket aria-modal attribute or Dialog focus trap is invented.",
  "semanticParts": {
    "root": {
      "kind": "controller",
      "description": "Controlled/uncontrolled menu ownership and cancellable requests; not a CSS root."
    },
    "portal": {
      "kind": "controller",
      "description": "Portal mounting context; positioner and popup remain source-owned."
    },
    "trigger": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-trigger\"]",
      "description": "Trigger uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "popup": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-content\"]",
      "description": "Popup uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "group": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-group\"]",
      "description": "Group uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "label": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-label\"]",
      "description": "Label uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "item": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-item\"]",
      "description": "Item uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "checkbox": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-checkbox-item\"]",
      "description": "Checkbox uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "radio-group": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-radio-group\"]",
      "description": "Radio group uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "radio": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-radio-item\"]",
      "description": "Radio uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "separator": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-separator\"]",
      "description": "Separator uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "shortcut": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-shortcut\"]",
      "description": "Shortcut uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "submenu-trigger": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-sub-trigger\"]",
      "description": "Submenu trigger uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "submenu-popup": {
      "kind": "element",
      "selector": "[data-slot=\"menubar-sub-content\"]",
      "description": "Submenu popup uses actual source slot; caller label/shortcut helper attributes only style these same actual elements."
    },
    "bar": {
      "kind": "element",
      "selector": "[data-slot=\"menubar\"]",
      "description": "Real native Menubar composite with separate menu owners."
    },
    "checkbox-indicator": {
      "kind": "element",
      "selector": ".cn-menubar-checkbox-item-indicator",
      "description": "Actual non-exported indicator wrapper; checked glyph is primitive-owned."
    },
    "radio-indicator": {
      "kind": "element",
      "selector": ".cn-menubar-radio-item-indicator",
      "description": "Actual non-exported indicator wrapper; checked glyph is primitive-owned."
    }
  },
  "visualStateMapping": {
    "itemVariant": {
      "prop": "variant",
      "values": [
        "default",
        "destructive"
      ]
    },
    "inset": {
      "prop": "inset",
      "attribute": "data-inset"
    },
    "highlighted": {
      "source": "BaseUI composite highlight",
      "attribute": "data-highlighted"
    },
    "checked": {
      "source": "actual CheckboxItem/RadioItem",
      "nativeAttribute": "aria-checked"
    }
  }
}
