Dropdown Menu
octane/dropdown-menuFreeComponent
octane publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by octane on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/octanejs/octane/main/packages/shadcn/registry/dropdown-menu.jsonSource
1// Base UI base dropdown-menu — runs on @octanejs/base-ui's `Menu`. Class strings come from the2// maintainer-supplied radix source; every difference below was verified by rendering the primitive3// and reading the DOM, not inferred.4//5// PART TREE. Radix's `Content` is one element; Base UI splits positioning out, exactly as this6// base's popover already does:7//8// radix Root > Portal > Content9// Base UI Root > Portal > Positioner > Popup (Positioner owns align/sideOffset)10//11// THREE CSS VARIABLES ARE RENAMED. Radix publishes per-component names; Base UI's Positioner12// publishes generic ones, and a utility pointing at a variable nothing sets silently does nothing:13//14// --radix-dropdown-menu-content-available-height -> --available-height15// --radix-dropdown-menu-trigger-width -> --anchor-width16// --radix-dropdown-menu-content-transform-origin -> --transform-origin17//18// THE SUBMENU TRIGGER'S OPEN ATTRIBUTE DIFFERS. Base UI marks an open trigger with19// `data-popup-open` (triggerOpenStateMapping), not the `data-open` the popup itself carries — so20// radix's `data-open:bg-accent` on the sub-trigger would never match and an open submenu's parent21// row would not stay highlighted.22//23// WHAT DOES CARRY OVER UNCHANGED, and is worth recording because it looks like it should not:24// radix styles item highlight with `focus:`, which works here because Base UI moves REAL DOM focus25// onto the highlighted item (checked by driving ArrowDown and reading document.activeElement) as26// well as publishing `data-highlighted`. `data-side`, `data-align`, `data-open`, `data-closed` and27// `data-disabled` are all emitted with the same spellings radix uses.28//29// TWO PARTS ARE PLAIN HOST ELEMENTS ON PURPOSE:30// - `Label` is a `<div>`, NOT `Menu.GroupLabel`. That part calls useMenuGroupRootContext and31// THROWS "MenuGroupContext is missing" outside a `Menu.Group`, while shadcn's label is32// routinely used standalone. Same trap as `Field.Label`, which already shipped as a crash once.33// - `Separator` is a `<div>`, because the Menu namespace has no Separator part at all (its34// sibling ContextMenu does). The radix classes are pure styling, so nothing is lost.35// POSITIONING PROPS BELONG TO THE POSITIONER, NOT THE POPUP. Radix has one `Content` element that36// takes them all; Base UI splits positioning into its own layer, so anything forwarded to `Popup`37// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from octane
All 44 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | octane | Components | Free | 2 deps | |
| Alertalert | octane | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | octane | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | octane | Components | Free | no deps | |
| Avataravatar | octane | Components | Free | 1 dep | |
| Badgebadge | octane | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | octane | Components | Free | 1 dep | |
| Buttonbutton | octane | Components | Free | 2 deps |
