Props
| Name | Description |
|---|---|
activator Type: ElementOrComponentRef | An external activator (element or component ref): the slot isn't rendered; the listeners and ARIA ( The no-wrapper alternative to the |
adaptive Type: booleanDefaultall.adaptive (true) | On mobile (below Unset resolves to the global |
anchor Type: ElementOrComponentRef | VirtualAnchorDefaultthe activator element | What the panel positions against instead of the activator (e.g. a wrapper around it): an element, a component ref or a virtual box. It also sets 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 | ElementOrComponentRef | Keeps the panel inside this element beside its trigger (sideways under a menu); away from it only the viewport flips it. An element, component ref or CSS selector (a |
closeOnSelect Type: booleanDefaultunset (close after a single-choice change) | Whether a selection closes the menu. Unset: a single-choice group's change closes it (an untick too, any depth), a |
compact Type: boolean | 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 panel (the phone sheet's too) at mount, not on the first open, and keeps its rows after a close; otherwise rows mount on each open and go after the close. |
emptyText Type: string | A pipeline group's no-items row; its 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 | A pipeline group's failed-load row (its getter threw); its own |
highlighted Type: unknown | The row focus is on ( |
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 | PrimitiveRow)[]Default[] | The menu rows, each a Three shapes, mixable: an item, a nested array (a divider-separated section), or a group object. |
keepActivator Type: booleanDefaultfalse | Keeps the trigger when no row is visible (by default it is hidden): inert, no popup ARIA, |
loadingText Type: string | A pipeline group's loading row; its own Pipeline groups only, and the default for all of them; a group can override it with its own |
model Type: Record<string, any> | Your object holding the menu's state by entry Pass a deeply reactive object ( |
modelValue Type: boolean | Whether the menu is open ( |
offCanvasProps Type: Partial<Omit<BbOffCanvasProps, "hideClose">> | 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: "cursor" | PlacementDefault"bottom" | Position relative to the activator; Every floating placement, plus |
pt Type: (PtCompoundOf<"", { readonly parts: readonly ["root", "panel", "sheet", "header", "footer", "box", "input", "list", "groupLabel", "groupHeader", "item", "itemText", "itemIcon", "itemDescription", "check", "submenu"]; readonly states: readonly ["activeLink", "exactActiveLink", "selected", "disabled", "open"]; readonly wide: readonly ["open"]; readonly node: { readonly item: readonly ["activeLink", "exactActiveLink", "selected", "disabled"]; readonly itemText: readonly ["activeLink", "exactActiveLink", "selected", "disabled"]; readonly itemIcon: readonly ["activeLink", "exactActiveLink", "selected", "disabled"]; readonly itemDescription: readonly ["activeLink", "exactActiveLink", "selected", "disabled"]; readonly check: readonly ["activeLink", "exactActiveLink", "selected", "disabled"]; }; readonly variant: { readonly names: readonly ["default", "destructive"]; readonly option: "dropdownItemVariants"; readonly parts: readonly ["item", "itemText", "itemIcon", "itemDescription", "check"]; }; }> & { footer?: PtValue | undefined; header?: PtValue | undefined; input?: PtValue | undefined; list?: PtValue | undefined; root?: PtValue | undefined; panel?: PtValue | undefined; "header:open"?: PtValue | undefined; "root:open"?: PtValue | undefined; "panel:open"?: PtValue | undefined; "item:disabled"?: PtValue | undefined; "item:selected"?: PtValue | undefined; "itemDescription:disabled"?: PtValue | undefined; sheet?: PtValue | undefined; "sheet:open"?: PtValue | undefined; "footer:open"?: PtValue | undefined; box?: PtValue | undefined; "input:open"?: PtValue | undefined; "box:open"?: PtValue | undefined; "item:open"?: PtValue | undefined; groupLabel?: PtValue | undefined; groupHeader?: PtValue | undefined; "list:open"?: PtValue | undefined; "itemDescription:open"?: PtValue | undefined; "itemText:open"?: PtValue | undefined; "groupLabel:open"?: PtValue | undefined; "groupHeader:open"?: PtValue | undefined; "itemIcon:open"?: PtValue | undefined; "check:open"?: PtValue | undefined; "submenu:open"?: PtValue | undefined; "item:activeLink"?: PtValue | undefined; "item:exactActiveLink"?: PtValue | undefined; "itemDescription:activeLink"?: PtValue | undefined; "itemDescription:exactActiveLink"?: PtValue | undefined; "itemDescription:selected"?: PtValue | undefined; "itemText:disabled"?: PtValue | undefined; "itemText:activeLink"?: PtValue | undefined; "itemText:exactActiveLink"?: PtValue | undefined; "itemText:selected"?: PtValue | undefined; "itemIcon:disabled"?: PtValue | undefined; "itemIcon:activeLink"?: PtValue | undefined; "itemIcon:exactActiveLink"?: PtValue | undefined; "itemIcon:selected"?: PtValue | undefined; "check:disabled"?: PtValue | undefined; "check:activeLink"?: PtValue | undefined; "check:exactActiveLink"?: PtValue | undefined; "check:selected"?: PtValue | undefined; "item:default"?: PtValue | undefined; "item:destructive"?: PtValue | undefined; "itemDescription:default"?: PtValue | undefined; "itemDescription:destructive"?: PtValue | undefined; "itemText:default"?: PtValue | undefined; "itemText:destructive"?: PtValue | undefined; "itemIcon:default"?: PtValue | undefined; "itemIcon:destructive"?: PtValue | undefined; "check:default"?: PtValue | undefined; "check:destructive"?: PtValue | undefined; } & { item?: PtValue | PtItemFn<InternalItem, BbDropdownPtState, "default" | "destructive", { readonly item: InternalItem; }> | undefined; itemDescription?: PtValue | PtItemFn<InternalItem, BbDropdownPtState, "default" | "destructive", { readonly item: InternalItem; }> | undefined; itemText?: PtValue | PtItemFn<InternalItem, BbDropdownPtState, "default" | "destructive", { readonly item: InternalItem; }> | undefined; itemIcon?: PtValue | PtItemFn<InternalItem, BbDropdownPtState, "default" | "destructive", { readonly item: InternalItem; }> | undefined; check?: PtValue | PtItemFn<InternalItem, BbDropdownPtState, "default" | "destructive", { readonly item: InternalItem; }> | undefined; submenu?: PtValue | PtItemFn<InternalItem, BbDropdownPtState, "default" | "destructive", { readonly item: InternalItem; }> | undefined; }) | 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 | The open / close transition (ms). Menus take the fast 150, not the popovers' 250: a menu is picked from and gone, quicker than a panel you read or edit. |
trigger Type: DropdownTrigger | DropdownTrigger[]Default"click" | What opens the menu, one or an array: 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 |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
highlighted Type: unknown | See example |
modelValue Type: boolean |
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, even when a controlled companion's app then refuses it. Payload: the row's value ( 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. |
update:highlighted Type: (value: unknown): void |
|
update:modelValue Type: (value: boolean): void | The menu opened or closed ( |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
<groupId>:append Type: BbDropdownItemSlotProps | The trailing region of that group's title line. |
<groupId>:group Type: BbDropdownGroupSlotProps | That group's |
<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>:label Type: BbDropdownItemSlotProps | That group's title content ( |
<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 placeholder row of a pipeline group that resolved to no items, once per empty group. A failed load is not empty: it keeps its own row (error icon, |
footer Type: BbDropdownEdgeSlotProps | Pinned below the rows, outside their scroll, with a divider — for action buttons. The pinned counterpart below the items, for one persistent action that must stay reachable while the list scrolls. |
group Type: BbDropdownGroupSlotProps | Every group's |
header Type: BbDropdownEdgeSlotProps | Pinned above the rows, outside their scroll, with 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 label), 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.
- slot
<groupId><groupId>:labelfails silently#<groupId>:label;:prepend/:appendare unchanged. 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
<BbDropdownBinding 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- option
offCanvasProps.hideCloseremovedfails silentlyAn
offCanvasPropskey, not a prop: the phone sheet never shows a ✕ (Escape, backdrop and swipe close it) — deletehideClose: falsefromoffCanvasProps.