Dropdown Menu
Base Dropdown Menu action-menu ownership, anatomy, evidence, and boundaries.
Base Dropdown Menu is a compound action-menu opened by a Trigger. Root owns visibility, request arbitration, collection order, entry policy, and shared facts; transient active navigation never becomes persistent selection.
Family and request ownership
Section titled “Family and request ownership”The canonical family contains one Root, at most one Trigger and Content, and up to 100 Items. All visibility changes—methods, Trigger activation, dismissal, and Item commit—enter Root’s openChange request channel.
Root accepts open, defaultOpen, disabled, closeOnItemCommit, openEntry, and openEntryValue. It exposes open state, collection facts, and openDropdown(), close(), toggle(), and requestOpen(). Controlled mode retains owner-provided open until new input arrives.
Content composes overlay, transition, collection navigation, typeahead, and anchor positioning. Item accepts value, textValue, disabled, and closeOnCommit; it exposes active/interaction facts and emits select. Closing clears transient active state, so reopening follows the new entry policy instead of restoring a false “selection.”
Accessibility boundary
Section titled “Accessibility boundary”This family represents actions or functions opened by a button. It must not disguise ordinary navigation, arbitrary forms, or persistent selection as a menu. Group, Label, Separator and Shortcut are bounded draft extensions below. Checkbox Item, Radio Item and Submenu remain outside this slice.
Package and generated facade
Section titled “Package and generated facade”The package entry is @proto.ui/prototypes-base/dropdown. The current source CLI registers base-dropdown and generates Root, Trigger, Content, and Item for the selected host. Group, Label, Separator, and Shortcut are additional package exports; this CLI target does not generate their facades.
T-BASE-DROPDOWN-MENU-0001 maps the family criteria to packages/prototypes/base/test/dropdown.test.ts. The preview declares Web Component, React, and Vue; that declaration does not establish new-head execution or packed-consumer acceptance.
Lifecycle
Section titled “Lifecycle”P-BASE-DROPDOWN-MENU and its Trigger, Content, and Item entities are draft. Published package availability does not promote them to active guarantees.
References
Section titled “References”- P-BASE-DROPDOWN-MENU
- Parts: Trigger, Content, Item
- Dropdown source
- Dropdown evidence
- Styled projection: Brutalist Dropdown Menu
Grouped action composition (draft)
Section titled “Grouped action composition (draft)”Group and Label provide a live accessible naming relationship; Separator and Shortcut are real passive parts. Shortcut only displays a hint and does not register a global binding. Decorative parts do not enter the action collection or add a press owner. The demo uses a 160px menu, grouped account/resources actions and a disabled API action. The real Invite users submenu is a separately pending protocol slice, not a simulated demo box. Checkbox/radio variants and complete native/GPUI, compiler, packed, visual and independent acceptance remain open.
Passing open selects controlled mode.
| Prop | Type | Default |
|---|---|---|
defaultOpen | boolean | false |
disabled | boolean | false |
closeOnItemCommit | boolean | true |
openEntry | string | active-or-first |
openEntryValue | string | '' |
These props belong to Root. Trigger has no props. Content accepts the Transition props and defaults side to bottom, align to center, sideOffset to 4, alignOffset and collisionPadding to 0, avoidCollisions to true and excludeAnchorTranslation to false. Item defaults disabled, value and textValue to false, '' and ''; closeOnCommit has no default and falls back to the Root policy. Group defaults a11yLabel to ''. Label, Separator and Shortcut have no props.