Props
| Name | Description |
|---|---|
activeClass Type: string | Class to apply when the link is active. |
adaptive Type: booleanDefaultall.adaptive (true) | On mobile (below Forwarded to the menu: unset follows the global |
append:icon Type: string | Icon to be added on the right of the text. |
ariaCurrentValue Type: "time" | "true" | "false" | "page" | "step" | "location" | "date"Default'page' | Value passed to the attribute |
async Type: booleanDefaultfalse | Inertia: runs the visit without blocking — the page stays interactive and several async visits can be in flight at once. |
block Type: boolean | Displays the component as full width. The extra width goes to the main button; the toggle keeps its own. Useful in a narrow column, not as a way to make the two halves match. See example |
cacheFor Type: string | number | (string | number)[] | Inertia: how long a prefetched response stays fresh before it is re-fetched. A single duration, or |
cacheTags Type: string | string[] | Inertia: tags to file this visit's prefetch cache under, so a later request can invalidate the whole tagged group. |
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: booleanDefaultfalse | Compact density, the Menu rows only (28px → 24px on the flyout, 44px → 36px on the sheet); the split button’s own height comes from |
component Type: string | Inertia: the page component this visit resolves to. Rarely set by hand — the server normally decides it. |
data Type: object | Request payload forwarded to Inertia when navigating via |
disableAutoLoading Type: booleanDefaultfalse | Disables the automatic loading state that tracks async actions (enabled by default). Only affects the main action button: the split toggle half still mirrors the dropdown's internal async-action loading state. Opts the main button out of tracking its own async |
disabled Type: booleanDefaultfalse | Disables both halves: the main button and the menu toggle. Freezes both halves at once. v2 |
download Type: string | boolean | Marks an |
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. |
exactActiveClass Type: string | Class to apply when the link is exact active. |
except Type: string[] | Inertia: the inverse of |
external Type: booleanDefaultfalse | Forces an |
form Type: string | The id of the |
headers Type: object | Additional HTTP headers forwarded to Inertia when navigating via |
href Type: string | { url: string; method: "get" | "post" | "put" | "patch" | "delete"; } | The link target: renders an anchor (an Inertia |
iconOnly Type: Responsive<boolean> | Shows only the button's icon ( |
id Type: string | Names this dropdown: the activator's id (unless it already has one), the menu's |
instant Type: booleanDefaultfalse | Inertia: navigate optimistically on click and reconcile when the response lands, instead of waiting for the round trip. |
interactiveWhileLoading Type: booleanDefaultfalse | Keeps the button clickable while it is loading. Buttons are disabled while loading by default; this escape hatch exists for toggles that must stay interactive (e.g. the dropdown-button caret). |
items Type: (BbDropdownItem | PrimitiveRow)[] | The menu: every entry is a row (BbDropdown's item model, groups and submenus included). The main action is the component itself (its default slot, Only the menu: every entry is a row, with BbDropdown’s item model (groups and submenus included). The main action is the component itself: its default slot, |
loading Type: booleanDefaultfalse | Triggers a loading indicator. A loading button is soft-disabled on its own ( Drives the main button by hand, for work the component cannot see. It does not touch the toggle. See example |
method Type: "get" | "post" | "put" | "patch" | "delete" | HTTP method used for Inertia navigation when |
model Type: Record<string, any> | Your object holding the menu's state by entry Forwarded to the inner dropdown: one object holding the menu’s state by entry id, as on BbDropdown. A |
offCanvasProps Type: Partial<Omit<BbOffCanvasProps, "hideClose">> | Props for the phone sheet (the Reaches the phone sheet only, e.g. a |
offset Type: numberDefault4 | Space the floating container will maintain from the activator. |
onBefore Type: (() => void) | Lifecycle hook invoked by Inertia right before the request is sent. |
onCancel Type: (() => void) | Lifecycle hook invoked by Inertia when a request is cancelled. |
onCancelToken Type: ((cancelToken: unknown) => void) | Receives the Inertia cancel token source when a request is initiated. Can be used to cancel the request.
Typed platform-agnostically (matching BbButton) so the library's types never require |
onError Type: ((errors: Record<string, string>) => void) | Inertia's hook for a VALIDATION error answer (the 422 path): the only failure callback |
onFinish Type: (() => void) | Lifecycle hook invoked by Inertia after the request has finished (regardless of success or error). |
only Type: string[] | Limits the properties that are preserved in Inertia partial reloads. |
onPrefetched Type: (() => void) | Lifecycle hook invoked by Inertia when a prefetch for this link has completed and is cached. |
onPrefetching Type: (() => void) | Lifecycle hook invoked by Inertia when a prefetch for this link starts. |
onProgress Type: ((progress: { percentage: number | undefined; }) => void) | Progress callback invoked by Inertia with the upload/download percentage when available. |
onStart Type: (() => void) | Lifecycle hook invoked by Inertia when a request starts. |
onSuccess Type: (() => void) | Lifecycle hook invoked by Inertia when a request succeeds. |
open Type: booleanDefaultfalse | Whether the panel is open ( |
padding Type: numberDefault10 | Minimum empty space to keep from the edge of the page |
pageProps Type: Record<string, unknown> | ((currentProps: Record<string, unknown>, sharedProps: Record<string, unknown>) => Record<string, unknown>) | null | Inertia: props to merge into the next page optimistically, before the server responds. Either an object or a function of the current props.
Typed platform-agnostically (matching BbButton) so the library's types never require |
placement Type: "cursor" | PlacementDefault'bottom' | Position relative to the activator; Resolved against the whole split control, not the toggle that opened the menu — so the default |
prefetch Type: string | boolean | string[] | Inertia: fetch and cache this link's page ahead of the click. |
prepend:icon Type: string | Icon to be added on the left of the text. Dresses the main button, as on BbButton. A menu row takes its own |
preserveScroll Type: boolean | ((props: Record<string, unknown>) => boolean)Defaultfalse | Controls whether Inertia should preserve the current scroll position after navigation. Can be a boolean or a predicate receiving the visit props. |
preserveState Type: boolean | ((props: Record<string, unknown>) => boolean) | nullDefaultfalse | Controls whether Inertia should preserve the current state after navigation. Can be a boolean or a predicate receiving the visit props. |
preserveUrl Type: booleanDefaultfalse | Inertia: keep the current URL in the address bar even though the page content changes. |
pt Type: (PtCompoundOf<"", { readonly parts: readonly ["root", "main", "toggle", "icon", "spinner", "text", "panel", "sheet", "header", "footer", "box", "input", "list", "groupLabel", "groupHeader", "item", "itemText", "itemIcon", "itemDescription", "check", "submenu"]; readonly states: readonly ["activeLink", "exactActiveLink", "selected", "disabled", "open", "loading"]; readonly wide: readonly ["activeLink", "exactActiveLink", "disabled", "open", "loading"]; readonly node: { readonly item: readonly ["selected"]; readonly itemText: readonly ["selected"]; readonly itemIcon: readonly ["selected"]; readonly itemDescription: readonly ["selected"]; readonly check: readonly ["selected"]; }; readonly variant: readonly [{ readonly names: readonly ["primary", "outline", "secondary", "ghost", "destructive", "link"]; readonly option: "buttonVariants"; readonly parts: readonly ["root", "main", "toggle", "icon", "spinner", "text"]; }, { 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; main?: PtValue | undefined; text?: PtValue | undefined; toggle?: PtValue | undefined; list?: PtValue | undefined; root?: PtValue | undefined; icon?: PtValue | undefined; panel?: PtValue | undefined; "header:disabled"?: PtValue | undefined; "header:open"?: PtValue | undefined; "root:disabled"?: PtValue | undefined; "root:open"?: PtValue | undefined; "icon:disabled"?: PtValue | undefined; "icon:open"?: PtValue | undefined; "panel:disabled"?: PtValue | undefined; "panel:open"?: PtValue | undefined; "text:outline"?: PtValue | undefined; "text:primary"?: PtValue | undefined; "text:destructive"?: PtValue | undefined; "root:outline"?: PtValue | undefined; "root:primary"?: PtValue | undefined; "root:destructive"?: PtValue | undefined; "icon:outline"?: PtValue | undefined; "icon:primary"?: PtValue | undefined; "icon:destructive"?: PtValue | undefined; spinner?: PtValue | undefined; "text:loading"?: PtValue | undefined; "text:activeLink"?: PtValue | undefined; "text:exactActiveLink"?: PtValue | undefined; "root:loading"?: PtValue | undefined; "root:activeLink"?: PtValue | undefined; "root:exactActiveLink"?: PtValue | undefined; "icon:loading"?: PtValue | undefined; "icon:activeLink"?: PtValue | undefined; "icon:exactActiveLink"?: PtValue | undefined; "spinner:loading"?: PtValue | undefined; "spinner:activeLink"?: PtValue | undefined; "spinner:exactActiveLink"?: PtValue | undefined; "text:secondary"?: PtValue | undefined; "root:secondary"?: PtValue | undefined; "icon:secondary"?: PtValue | undefined; "spinner:outline"?: PtValue | undefined; "spinner:primary"?: PtValue | undefined; "spinner:destructive"?: PtValue | undefined; "spinner:secondary"?: PtValue | undefined; "text:disabled"?: PtValue | undefined; "item:disabled"?: PtValue | undefined; "spinner:disabled"?: PtValue | undefined; "text:link"?: PtValue | undefined; "text:ghost"?: PtValue | undefined; "root:link"?: PtValue | undefined; "root:ghost"?: PtValue | undefined; "icon:link"?: PtValue | undefined; "icon:ghost"?: PtValue | undefined; "spinner:link"?: PtValue | undefined; "spinner:ghost"?: PtValue | undefined; "item:selected"?: PtValue | undefined; "list:disabled"?: PtValue | undefined; "list:loading"?: PtValue | undefined; "item:loading"?: PtValue | undefined; "itemDescription:disabled"?: PtValue | undefined; "itemDescription:loading"?: PtValue | undefined; sheet?: PtValue | undefined; "sheet:open"?: PtValue | undefined; "footer:open"?: PtValue | undefined; box?: PtValue | undefined; "input:disabled"?: PtValue | undefined; "input:open"?: PtValue | undefined; "input:loading"?: PtValue | undefined; "panel:loading"?: PtValue | undefined; "spinner:open"?: PtValue | undefined; "sheet:disabled"?: PtValue | undefined; "sheet:loading"?: PtValue | undefined; "box:disabled"?: PtValue | undefined; "box:open"?: PtValue | undefined; "box:loading"?: PtValue | undefined; "text:open"?: PtValue | undefined; "item:open"?: PtValue | undefined; "header:loading"?: 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; "footer:disabled"?: PtValue | undefined; "footer:loading"?: PtValue | undefined; "footer:activeLink"?: PtValue | undefined; "footer:exactActiveLink"?: PtValue | undefined; "header:activeLink"?: PtValue | undefined; "header:exactActiveLink"?: PtValue | undefined; "input:activeLink"?: PtValue | undefined; "input:exactActiveLink"?: PtValue | undefined; "main:disabled"?: PtValue | undefined; "main:open"?: PtValue | undefined; "main:loading"?: PtValue | undefined; "main:activeLink"?: PtValue | undefined; "main:exactActiveLink"?: PtValue | undefined; "toggle:disabled"?: PtValue | undefined; "toggle:open"?: PtValue | undefined; "toggle:loading"?: PtValue | undefined; "toggle:activeLink"?: PtValue | undefined; "toggle:exactActiveLink"?: PtValue | undefined; "list:activeLink"?: PtValue | undefined; "list:exactActiveLink"?: PtValue | undefined; "panel:activeLink"?: PtValue | undefined; "panel:exactActiveLink"?: PtValue | undefined; "itemText:loading"?: PtValue | undefined; "sheet:activeLink"?: PtValue | undefined; "sheet:exactActiveLink"?: PtValue | undefined; "box:activeLink"?: PtValue | undefined; "box:exactActiveLink"?: PtValue | undefined; "groupLabel:disabled"?: PtValue | undefined; "groupLabel:loading"?: PtValue | undefined; "groupLabel:activeLink"?: PtValue | undefined; "groupLabel:exactActiveLink"?: PtValue | undefined; "groupHeader:disabled"?: PtValue | undefined; "groupHeader:loading"?: PtValue | undefined; "groupHeader:activeLink"?: PtValue | undefined; "groupHeader:exactActiveLink"?: PtValue | undefined; "itemIcon:loading"?: PtValue | undefined; "check:loading"?: PtValue | undefined; "submenu:disabled"?: PtValue | undefined; "submenu:loading"?: PtValue | undefined; "submenu:activeLink"?: PtValue | undefined; "submenu:exactActiveLink"?: PtValue | undefined; "main:link"?: PtValue | undefined; "main:outline"?: PtValue | undefined; "main:primary"?: PtValue | undefined; "main:destructive"?: PtValue | undefined; "main:secondary"?: PtValue | undefined; "main:ghost"?: PtValue | undefined; "toggle:link"?: PtValue | undefined; "toggle:outline"?: PtValue | undefined; "toggle:primary"?: PtValue | undefined; "toggle:destructive"?: PtValue | undefined; "toggle:secondary"?: PtValue | undefined; "toggle:ghost"?: PtValue | undefined; } & { item?: PtValue | PtItemFn<InternalItem, BbDropdownButtonPtState, "default" | "destructive"> | undefined; itemDescription?: PtValue | PtItemFn<InternalItem, BbDropdownButtonPtState, "default" | "destructive"> | undefined; itemText?: PtValue | PtItemFn<InternalItem, BbDropdownButtonPtState, "default" | "destructive"> | undefined; itemIcon?: PtValue | PtItemFn<InternalItem, BbDropdownButtonPtState, "default" | "destructive"> | undefined; check?: PtValue | PtItemFn<InternalItem, BbDropdownButtonPtState, "default" | "destructive"> | undefined; submenu?: PtValue | PtItemFn<InternalItem, BbDropdownButtonPtState, "default" | "destructive"> | undefined; }) | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | ((ctx: PtItemCtx<InternalItem, BbDropdownButtonPtState, "default" | "destructive">) => PtItemResult) | Passthrough, attribute form: one attribute per part,
|
queryStringArrayFormat Type: "brackets" | "indices"Default'brackets' | Format to use when serializing array values into the query string for Inertia requests. |
replace Type: booleanDefaultfalse | Calls |
size Type: Responsive<Sizes>Defaultcomponents.BbButton.size, else 'md' | Sets the size of the button. When the value is a string, it will be applied to all screen sizes. Otherwise, it will be applied to the screen size specified by the object. Unset: Shared by both halves, and takes the responsive map form ( |
tag Type: ButtonTagDefault'button' | Element to render for the plain (non-link, non-router) button: |
target Type: string | Sets or retrieves the window or frame at which to target content. |
text Type: string | Text content of the component. |
to Type: string | et | X | Route Location the link should navigate to when clicked on. |
toggle:icon Type: string | Replaces the chevron shown inside the dropdown toggle button. A constrained alternative to a slot: only the toggle's icon changes, so the button keeps its semantics. Named after the part it sits in (the Swaps the toggle’s chevron and nothing else — an overflow "…" for a dense row. Deliberately a prop rather than a slot: there is no |
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. |
type Type: "button" | "reset" | "submit" | Gets the classification and default behavior of the button. |
variant Type: ButtonVariantTypeDefaultcomponents.BbButton.variant, else 'primary' | Visual variant shared by both buttons of the split control. Shared by both halves, from BbButton’s ladder — a name registered in |
viewTransition Type: booleanDefaultfalse | Inertia: run the page swap inside a View Transition, where the browser supports one. |
width Type: string | numberDefault'auto' | Width of the dropdown in pixels, percentage, or 'auto' to fit content. A percentage resolves against the split control’s width, still floored at the menu’s 128px minimum. |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
open Type: boolean |
Events
| Name | Description |
|---|---|
hide Type: (): void | Emitted as soon as the menu starts to close. |
item:selected Type: (value: any): void | A row of a selectable group was selected — the menu's own event, re-emitted with the same payload (the item's resolved value). Re-emitted from the menu with the same payload, the row’s value. Bind the group’s |
item:unselected Type: (value: any): void | A row of a selectable group was unselected (same payload as above). See example |
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:open Type: (value: boolean): void | The panel 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 |
<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 |
<value>:append Type: BbDropdownItemSlotProps | One row's trailing region; replaces its |
<value>:prepend Type: BbDropdownItemSlotProps | One row's leading region; replaces its |
append:icon Type: BbButtonIconSlotProps | The main button's trailing icon, replacing |
default Type: any | The main button's label (falls back to |
dropdown Type: any | Menu companions, forwarded into the dropdown: a |
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. Forwarded to the underlying |
footer Type: BbDropdownButtonEdgeSlotProps | Content pinned to the bottom of the dropdown panel, outside the scroll area. See example |
header Type: BbDropdownButtonEdgeSlotProps | Content pinned to the top of the dropdown panel, outside the scroll area. Forwarded into the inner dropdown unchanged, along with |
item:append Type: BbDropdownButtonItemSlotProps | The trailing region of every menu row, replacing its |
item:prepend Type: BbDropdownButtonItemSlotProps | The leading region of every menu row, replacing its Replaces every menu row’s |
loading Type: BbDropdownPlaceholderSlotProps | Replaces the default loading placeholder row shown in a pipeline group while its async items load. Rendered once per loading group. Forwarded to the underlying |
prepend:icon Type: BbButtonIconSlotProps | The main button's leading icon, replacing |
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 silentlyautoLoadingdisableAutoLoadingfails silentlyiconprepend:iconfails silentlyAn icon-only button:
prepend:icon="…" icon-only, and write the label (the slot ortext): it stays the accessible name.- slot
iconprepend:iconfails silentlyAn icon-only button:
#prepend:iconwithicon-only. - 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. - slot
no-dataemptyfails silently right:icontoggle:iconfails silentlythemevariantfails silently