Props
| Name | Description |
|---|---|
activator Type: Record<string, any> | HTMLElement | null | An external activator element or component ref: the activator slot is not rendered, and the listeners and ARIA ( The no-wrapper alternative to the |
adaptive Type: booleanDefaultconfig.adaptive (true) | On mobile (below Unset resolves to the global |
anchor Type: Record<string, any> | HTMLElement | nullDefaultthe activator element | The element the panel positions against when it should differ from the activator (a wrapper the activator is part of); an HTMLElement or component ref. It also drives a percentage Positions the panel against something other than the trigger — the case being a control whose trigger is only part of it, like the toggle half of a split button. A percentage |
boundary Type: string | Record<string, any> | HTMLElement | null | Keeps the panel inside this element alongside its trigger (sideways for a menu above or below); away from the trigger it may pass the edge, and only the viewport flips it. An HTMLElement, a component ref or a CSS selector: a |
closeOnSelect Type: booleanDefaultunset (close after a single-choice change) | Whether a selection closes the menu. Unset: a change in a single-choice group closes it (an untick too, at any depth); a |
compact Type: booleanDefaultfalse | Compact density, the |
disabled Type: booleanDefaultfalse | Disables the component Freezes the whole component, trigger included. It is not the same as disabling every item: a disabled item is skipped by keyboard navigation while the menu still opens. |
eager Type: booleanDefaultfalse | Renders the menu panel at mount instead of on the first open (the phone sheet's too), and keeps its rows after a close. Without it the rows mount on each open and go once the menu has closed. |
emptyText Type: string | Default placeholder text shown when a pipeline group resolves to no items. A group's own The empty-result counterpart of |
enforceCoherence Type: booleanDefaultfalse | Default for pipeline groups: drop selections that are no longer present in a group's current items (e.g. after a The dropdown-level default for pipeline groups, overridable per group. It stays lazy: a group nobody opened never fetches and never prunes, and pruning never runs against an empty or still-loading item set. |
failedText Type: string | Default placeholder text shown when a pipeline group's latest load FAILED (its |
id Type: string | Names this dropdown: the activator's id (unless it already has one), the menu's Name the dropdown when something outside it reads its state: |
items requiredType: BbDropdownItem[]Default[] | The menu rows, each a Three shapes, mixable: an item, a nested array (a divider-separated section), or a group object. |
loadingText Type: string | Default placeholder text shown while a pipeline group's async items load. A group's own Pipeline groups only, and the default for all of them; a group can override it with its own |
offCanvasProps Type: Partial<BbOffCanvasProps> | Props for the phone sheet (the Merged over the sheet’s own |
offset Type: numberDefault4 | Space the floating container will maintain from the activator. |
padding Type: numberDefault10 | Minimum empty space to keep from the edge of the page |
placement Type: Placement | "cursor"Default"bottom" | Position of the dropdown relative to the activator. Use Every floating placement, plus |
pt Type: PtItemMap<BbDropdownPtPart, BbDropdownItemPtPart, BbDropdownPtState, InternalItem, "default" | "destructive"> | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | ((ctx: PtItemCtx<InternalItem, BbDropdownPtState, "default" | "destructive">) => PtItemResult) | Passthrough, attribute form: one attribute per part, |
queryDebounceTime Type: numberDefault300 | Debounce (ms) applied to the async re-fetch a Applies to a |
transitionDuration Type: numberDefault150 | How long the transition has to last in milliseconds. Menus use the fast transition (150) rather than the medium one (250) the other popovers default to: a menu is opened to pick one command and is gone again, so it answers faster than a panel the user reads or edits in. |
trigger Type: DropdownTrigger | DropdownTrigger[]Default"click" | Interaction(s) that open the dropdown. Accepts a single trigger or an array to combine them.
- Takes an array to combine them ( |
width Type: string | numberDefault"auto" | Width of the dropdown in pixels, percentage, or 'auto' to fit content. Content-sized by default with a 128px floor — not a fixed width. Pass a number when menus have to line up across the rows of a table, and a percentage when the panel should match its trigger. See example |
Events
| Name | Description |
|---|---|
hide Type: (): void | Emitted as soon as the menu starts to close. |
item:selected Type: (value: any): void | The user selected a row in a selectable group, at the click — also when a controlled companion's app then refuses the value. The payload is the row's value (its Fires for any selectable group with the changed item’s value — its |
item:unselected Type: (value: any): void | The user unselected a row (a multiple toggle, a Fires when a row of a |
show Type: (): void | Emitted as soon as the menu (the popover, or the sheet on a phone) starts to open. |
shown Type: (): void | Emitted once the menu is open and its open transition has finished. |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
<groupId> Type: BbDropdownItemSlotProps | That group's title line (the group is passed as |
<groupId>:append Type: BbDropdownItemSlotProps | The trailing region of that group's title line. |
<groupId>:item Type: BbDropdownItemSlotProps | The content of every row of that group, and no other; a row's own |
<groupId>:item:append Type: BbDropdownItemSlotProps | The trailing region of every row of that group; replaces their |
<groupId>:item:prepend Type: BbDropdownItemSlotProps | The leading region of every row of that group — e.g. an avatar per record, drawn from The switcher slot: draw each record (an avatar, a logo) from |
<groupId>:prepend Type: BbDropdownItemSlotProps | The leading region of that group's title line. |
<value> Type: BbDropdownItemSlotProps | One row's content (label and description), by its value; in a fetched group, by its resolved Named after the row’s |
<value>:append Type: BbDropdownItemSlotProps | One row's trailing region; replaces its The only slot that can replace a row’s submenu chevron. On the selected row of a selectable group the check still wins. See example |
<value>:prepend Type: BbDropdownItemSlotProps | One row's leading region; replaces its |
activator Type: BbDropdownActivatorSlotProps | The element that triggers the dropdown to open. Spread Spread its |
default Type: any | Hosts |
empty Type: BbDropdownPlaceholderSlotProps | Replaces the default "no data" placeholder row shown in a pipeline group that resolved to no items. Rendered once per empty group. |
footer Type: BbDropdownEdgeSlotProps | Content pinned to the bottom of the dropdown panel, outside the scroll area. Stays visible while the items scroll and is separated from them by a divider — for action buttons. The pinned counterpart below the items, for one persistent action that must stay reachable while the list scrolls. |
header Type: BbDropdownEdgeSlotProps | Content pinned to the top of the dropdown panel, outside the scroll area. Stays visible while the items scroll and is separated from them by a divider — for a title or a filter field. Pinned above the scrolling items and separated by a divider — a title, or a field that filters the list you build. On the adaptive sheet it becomes the sheet’s pinned header. |
item:append Type: BbDropdownItemSlotProps | The trailing region of every row (and group title line), replacing its Replaces the rows’ |
item:prepend Type: BbDropdownItemSlotProps | The leading region of every row (and group title line), replacing its Rendered before every row’s content, group titles included — there |
loading Type: BbDropdownPlaceholderSlotProps | Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group. |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
arrowPaddingremovedfails silently- item field
items[].keyitems[].valuefails silentlyA row's identity: its
v-modelvalue (any type, compared by hash) and its#<value>slots;check --fixrenames it. - item field
items[].textitems[].labelfails silentlyA row's text;
check --fixrenames it. - item field
items[group].keyitems[group].idfails silentlyA group's identity, the same word as
<BbDropdownGroup id>;check --fixrenames it. - method
loadingremovedfails silentlyRead
loadingfrom the activator slot scope (#activator="{ loading }") instead of a template ref. - slot
no-dataemptyfails silently noDataTextemptyTextfails silently