Skip to content

BbDropdownButton

A button with primary action and all other actions collected in a dropdown.

import { BbDropdownButton } from 'bitboss-ui';

On this page

Props

NameTypeDefaultDescription
append:iconstring | undefined-

Icon to be added on the right of the text.

blockboolean | undefinedfalse

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
disableAutoLoadingboolean | undefinedfalse

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 onClick; the toggle keeps reflecting menu-action state either way. Replaces v2 autoLoading with the polarity inverted, so a leftover :auto-loading="false" does nothing and nothing warns.

See example
disabledboolean | undefinedfalse

Disables the component

Freezes both halves at once. v2 disabledWhileLoading is gone: a busy half is always disabled now, which is what stops a second click racing the pending action.

eagerboolean | undefinedfalse

Prevents rendering content before it's made visible.

idstring | undefined-

The identifier of the component.

itemsrequiredItem[][]

Array used to render each dropdown button. They can act as button, as a, or as router-link as they are based on the functionality provided by BbBaseButton. Pass a flat array for a single group, nest arrays for divider-separated groups, or pass {@link InternalGroup} objects for titled / selectable sections. An item may carry its own items to open a submenu. The shapes can be mixed.

BbDropdown’s item model, with one rule of its own: items[0] is promoted into the main button, so keep it a plain leaf item. A leading group or nested array contributes only its first leaf and loses its remaining rows, silently.

See example
loadingboolean | undefinedfalse

Triggers a loading indicator.

Drives the main button by hand, for work the component cannot see. It does not touch the toggle.

See example
offsetnumber | undefined3

Space the floating container will maintain from the activator.

paddingnumber | undefined10

Minimum empty space to keep from the edge of the page

placementPlacement | "cursor" | undefined'bottom'

Position of the dropdown relative to the activator. Use 'cursor' to anchor at the mouse/touch coordinates. (No arrow is drawn either way — arrows are tooltip-only in v3.)

Resolved against the whole split control, not the toggle that opened the menu — so the default bottom centres the panel under the pair. trigger is not exposed: the toggle always opens on click.

See example
prepend:iconstring | undefined-

Icon to be added on the left of the text.

Dresses the main button, because items[0]’s own icons are ignored. This is where the primary action’s glyph belongs.

See example
ptBbDropdownButtonPtMap | undefined-

Passthrough, object form: the same keys as the pt:* attributes without the prefix. See the pt:<part> row.

pt:iconPtValue | undefined-
pt:icon:disabledPtValue | undefined-
pt:icon:loadingPtValue | undefined-
pt:icon:openPtValue | undefined-
pt:itemPtValue | ((ctx: PtItemCtx<InternalItem, BbDropdownButtonPtState>) => PtItemResult) | undefined-
pt:item-descriptionPtValue | ((ctx: PtItemCtx<InternalItem, BbDropdownButtonPtState>) => PtItemResult) | undefined-
pt:item-description:disabledPtValue | undefined-
pt:item-description:loadingPtValue | undefined-
pt:item-description:openPtValue | undefined-
pt:item-description:selectedPtValue | undefined-
pt:item-iconPtValue | ((ctx: PtItemCtx<InternalItem, BbDropdownButtonPtState>) => PtItemResult) | undefined-
pt:item-icon:disabledPtValue | undefined-
pt:item-icon:loadingPtValue | undefined-
pt:item-icon:openPtValue | undefined-
pt:item-icon:selectedPtValue | undefined-
pt:item-textPtValue | ((ctx: PtItemCtx<InternalItem, BbDropdownButtonPtState>) => PtItemResult) | undefined-
pt:item-text:disabledPtValue | undefined-
pt:item-text:loadingPtValue | undefined-
pt:item-text:openPtValue | undefined-
pt:item-text:selectedPtValue | undefined-
pt:item:disabledPtValue | undefined-
pt:item:loadingPtValue | undefined-
pt:item:openPtValue | undefined-
pt:item:selectedPtValue | undefined-
pt:panelPtValue | undefined-
pt:panel:disabledPtValue | undefined-
pt:panel:loadingPtValue | undefined-
pt:panel:openPtValue | undefined-
pt:rootPtValue | undefined-
pt:root:disabledPtValue | undefined-
pt:root:loadingPtValue | undefined-
pt:root:openPtValue | undefined-
pt:sheetPtValue | undefined-
pt:sheet:disabledPtValue | undefined-
pt:sheet:loadingPtValue | undefined-
pt:sheet:openPtValue | undefined-
pt:spinnerPtValue | undefined-
pt:spinner:disabledPtValue | undefined-
pt:spinner:loadingPtValue | undefined-
pt:spinner:openPtValue | undefined-
pt:textPtValue | undefined-
pt:text:disabledPtValue | undefined-
pt:text:loadingPtValue | undefined-
pt:text:openPtValue | undefined-
right:iconstring | undefined-

Replaces the chevron shown inside the right-side dropdown toggle button. A constrained alternative to a slot: only the toggle's icon changes, so the button keeps its semantics. Named for consistency with prepend:icon / append:icon.

Swaps the toggle’s chevron and nothing else — an overflow "…" for a dense row. Deliberately a prop rather than a slot: there is no activator slot, because the toggle is part of the contract.

See example
sizeResponsive<Sizes> | undefined"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.

Shared by both halves, and takes the responsive map form ({ sm: "sm", lg: "md" }). Setting it on items[0] does nothing.

See example
transitionDurationnumber | undefined150

How long the transition has to last in milliseconds. Menus use the fast transition rather than the medium one the other popovers default to.

variantButtonVariantType | undefined"primary"

Visual variant shared by both buttons of the split control.

Shared by both halves, from BbButton’s ladder — a name registered through buttonVariants works here too. Replaces v2 theme. The primary item’s own variant is ignored, so the pair can never disagree.

See example
widthstring | number | undefined'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. anchor is not exposed here because it is hard-wired to that control.

See example

Events

NameTypeDescription
hidden(event: "hidden"): void
hide(event: "hide"): void
show(event: "show"): void
shown(event: "shown"): void

Slots

The listed properties are the ones exposed to the slot scope.

NameTypeDescription
<groupKey>BbDropdownItemSlotProps

That group's title line (the group is passed as item, groupTitle is true).

<groupKey>:appendBbDropdownItemSlotProps

The trailing region of that group's title line.

<groupKey>:itemBbDropdownItemSlotProps

The content of every row of that group, and no other; a row's own #<key> still wins.

<groupKey>:item:appendBbDropdownItemSlotProps

The trailing region of every row of that group; replaces their append:icon. The check takes its place on the selected row.

<groupKey>:item:prependBbDropdownItemSlotProps

The leading region of every row of that group — e.g. an avatar per record, drawn from item.meta, while other rows keep their prepend:icon.

<groupKey>:prependBbDropdownItemSlotProps

The leading region of that group's title line.

<key>BbDropdownItemSlotProps

One row's content (text and description), by its key; in a fetched group, by its resolved itemValue.

<key>:appendBbDropdownItemSlotProps

One row's trailing region; replaces its append:icon and its submenu chevron. The check takes its place on the selected row.

<key>:prependBbDropdownItemSlotProps

One row's leading region; replaces its prepend:icon.

defaultany

Companion content forwarded into the dropdown (e.g. <BbDropdownGroup>).

footerBbDropdownButtonEdgeSlotProps

Content pinned to the bottom of the dropdown panel, outside the scroll area.

See example
headerBbDropdownButtonEdgeSlotProps

Content pinned to the top of the dropdown panel, outside the scroll area.

Forwarded into the inner dropdown unchanged, along with footer, the edge slots and per-key slots. A per-key slot for items[0] renders nothing — that item never becomes a menu row.

See example
item:appendBbDropdownButtonItemSlotProps

The trailing region of every menu row, replacing its append:icon; the submenu chevron and the check on a selected row take its place (BbDropdown's rules).

See example
item:prependBbDropdownButtonItemSlotProps

The leading region of every menu row, replacing its prepend:icon (BbDropdown's rules).

Replaces every menu row’s prepend:icon; per-group and per-key slots beat it, as on BbDropdown. items[0] never sees it — dress the main button with prepend:icon.

See example
loadingBbDropdownPlaceholderSlotProps

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 BbDropdown.

no-dataBbDropdownPlaceholderSlotProps

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 BbDropdown.

Changes from v2

Props removed or renamed in 3.0. If you are coming from v2, the answer is here.

  • arrowPaddingremovedfails silently
  • autoLoadingdisableAutoLoadingfails silently
  • themevariantfails silently