Props
| Name | Description |
|---|---|
activator Type: ElementOrComponentRef | External activator element or component ref. When provided, the activator slot is not rendered and event listeners are attached programmatically to the referenced element. |
adaptive Type: booleanDefaultall.adaptive (true) | On mobile, the panel opens as a bottom sheet instead of a floating popover, with the same search and list. Unset, the global Set it per instance only to disagree with the app-wide |
anchor Type: ElementOrComponentRefDefaultnull | Override the element used for popover positioning and width measurement. Useful when the focusable activator is narrower than its visual container (e.g. a button inside a wrapper). Falls back to |
ariaDescribedby Type: string | string[] | Space-separated IDREF(s) that describe this field for assistive technologies. Accepts either a string or array of ids. The popover has no message area. Render the error or warning next to your trigger and pass its id here: it lands on the trigger and on the search field. See example |
ariaInvalid Type: boolean | Explicit invalid state for accessibility semantics. Falls back to |
autocomplete Type: stringDefault"off" | Browser autocomplete hint for the popover search input. |
boundary Type: ElementOrComponentRefOrSelector | An element the popover stays inside alongside its trigger (sideways for one above or below). Away from the trigger it may pass the edge, and it flips at the viewport only. |
clearable Type: booleanDefaultfalse | Shows a clear button in the search field, in the lens' place while there is a query or a selection; it resets both. None without a search field. Leave it off when the activator already clears (as BbSelect's does). Puts a small clear button inside the search field's icon stack (not on your trigger), so a list without a search field gets none. For an explicit "empty this" most triggers want the |
compact Type: boolean | Apply the compact density variant. |
createText Type: ((query: string) => string)Defaultthe locale's select.createOption | The create row's words ( |
dependencies Type: unknown[]Default[] | Additional dependencies that trigger item reloading when changed. Compared by value hash, not by reference. Pair it with |
depsDebounceTime Type: numberDefault0 | Debounce delay (ms) for dependency-triggered reloads. |
disabled Type: booleanDefaultfalse | Disables the component. |
disableFlip Type: booleanDefaultfalse | Disables the automatic flip to the opposite side when the popover would overflow (flipping is on by default). Inverts v2's |
disableWriting Type: boolean | "auto" | "mobile" | "desktop"Default'auto' | Hides the panel's search field: Removes the search field, and with it typing, |
emptyText Type: stringDefaultthe localized common.emptyText ("No data to display"); a
search with no matches common.noMatchesText ("No results found") | Message displayed when no items are available, a search that matched nothing included. |
enforceCoherence Type: booleanDefaultfalse | Drops the picks the items no longer contain (single: Opts each instance into a load of its own, because validating a seeded value is impossible without options. One filter costs one request; fifty provider-backed rows cost fifty. That is the reason a table hands every row the same array instead. See example |
failedText Type: stringDefaultthe localized common.failedText ("Couldn't load items") | Message displayed in the empty state while the latest load FAILED (the provider threw): the twin of |
filterBy Type: false | string[]Default[] | What typing filters on: empty = the display text and description; item paths = those fields ( Replaces the match against the display text rather than adding to it, and every listed path must exist on every item or matching throws. With a provider it still applies on top of the response; |
groupBy Type: string | ((item: Item) => string | number | symbol) | Path to item property for grouping options. |
hasErrors Type: booleanDefaultfalse | Marks the component as being in error state. Paints the error icon in the search field and sets |
hasWarnings Type: booleanDefaultfalse | Marks the component as being in a warning state. Visually mirrors |
headerHeight Type: number | Height of group headers in the listbox (px). Defaults to 32px (24px compact; 36px / 32px on mobile viewports). Only applies when |
highlighted Type: unknown | Highlighted option's value, or |
id Type: string | Seeds the ids the popover sets: its listbox is |
itemHeight Type: numberDefault28 | Height of the options in the listbox (px). Defaults to 28px (24px compact; 44px / 36px on mobile viewports). An explicit value wins on every viewport. |
itemProps Type: BbSelectItemProps<Item> | ADDITIONAL row fields, never the text or value: |
items requiredType: Item[] | ((context: BbSelectPopoverItemsContext) => Item[] | Promise<Item[]>)Default[] | The options: an array, or a sync or async provider given a An array resolves on mount and costs nothing per instance, which is what makes one popover per table row viable. A function is per-instance, so reach for it only when the options genuinely depend on that instance. See example |
itemText Type: ItemAccessor<Item, string>Defaultown label, else text, else JSON.stringify(item) | Path to item property for display text or function to extract it.
Unset: own |
itemValue Type: ItemAccessor<Item>Defaultown value, else the whole item | Path to item property for value or function to extract it.
Unset: own |
knownItems Type: ([Known] extends [undefined] ? BbSelectKnownItems : Known) |
|
loading Type: booleanDefaultfalse | Display the loading state styles. |
loadingText Type: string | Message shown while items are being loaded. |
max Type: numberDefaultInfinity | Maximum number of selectable items (limits selection when Applies to |
minQueryLength Type: numberDefault0 | Characters to type (trimmed) before the query searches. Below it the query counts as empty: no |
modelValue requiredType: any | v-model value. Single value for single select, array for multiple select. |
modelValueDebounceTime Type: numberDefault0 | Debounce delay (ms) for modelValue change handling. |
multiple Type: booleanDefaultfalse | Enable multiple item selection. When true, modelValue must be an array. The model must already be an array on the first render, and there is no chip row: summarising the selection on your trigger is part of owning it. See example |
offCanvasProps Type: Partial<Omit<BbOffCanvasProps, "hideClose">> | Props for the phone sheet (the |
offset Type: numberDefault4 | Distance (px) between the activator and the popover. |
open Type: booleanDefaultfalse | Whether the panel is open ( |
padding Type: numberDefault10 | Minimum page padding used by floating shift middleware. |
placement Type: PlacementDefault"bottom" | Floating placement of the popover. |
prefill Type: boolean | "interaction"Default"interaction" | When the options first load: Unlike an in-field |
pt Type: (PtCompoundOf<"", { readonly parts: readonly ["root", "panel", "sheet", "input", "clear", "list", "groupHeader", "option", "itemText", "itemIcon", "itemDescription", "check", "header", "footer"]; readonly states: readonly ["selected", "disabled", "open"]; readonly wide: readonly ["open"]; readonly node: { readonly option: readonly ["selected", "disabled"]; readonly itemText: readonly ["selected", "disabled"]; readonly itemIcon: readonly ["selected", "disabled"]; readonly itemDescription: readonly ["selected", "disabled"]; readonly check: readonly ["selected", "disabled"]; readonly groupHeader: readonly ["disabled"]; }; }> & { 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; clear?: PtValue | undefined; "itemDescription:disabled"?: PtValue | undefined; sheet?: PtValue | undefined; "sheet:open"?: PtValue | undefined; "footer:open"?: PtValue | undefined; "input:open"?: PtValue | undefined; "clear:open"?: PtValue | undefined; groupHeader?: PtValue | undefined; "list:open"?: PtValue | undefined; "itemDescription:open"?: PtValue | undefined; "itemText:open"?: PtValue | undefined; "groupHeader:open"?: PtValue | undefined; "itemIcon:open"?: PtValue | undefined; "check:open"?: PtValue | undefined; "itemDescription:selected"?: PtValue | undefined; "itemText:disabled"?: PtValue | undefined; "itemText:selected"?: PtValue | undefined; "itemIcon:disabled"?: PtValue | undefined; "itemIcon:selected"?: PtValue | undefined; "check:disabled"?: PtValue | undefined; "check:selected"?: PtValue | undefined; "groupHeader:disabled"?: PtValue | undefined; "option:open"?: PtValue | undefined; "option:disabled"?: PtValue | undefined; "option:selected"?: PtValue | undefined; } & { option?: PtValue | PtItemFn<Item, BbSelectPopoverPtState, never, BbSelectSlotRow<Item, Known>> | undefined; itemDescription?: PtValue | PtItemFn<Item, BbSelectPopoverPtState, never, BbSelectSlotRow<Item, Known>> | undefined; itemText?: PtValue | PtItemFn<Item, BbSelectPopoverPtState, never, BbSelectSlotRow<Item, Known>> | undefined; itemIcon?: PtValue | PtItemFn<Item, BbSelectPopoverPtState, never, BbSelectSlotRow<Item, Known>> | undefined; check?: PtValue | PtItemFn<Item, BbSelectPopoverPtState, never, BbSelectSlotRow<Item, Known>> | undefined; }) | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | ((ctx: PtItemCtx<Item, BbSelectPopoverPtState, never, BbSelectSlotRow<Item, Known>>) => PtItemResult) | Passthrough, attribute form: one attribute per part, |
query Type: string | The search field's text ( |
queryDebounceTime Type: numberDefault500 | Debounce delay (ms) before triggering search queries after user input stops. |
readonly Type: booleanDefaultfalse | Prevents opening the popover while keeping the activator accessible. |
searchInputAriaLabel Type: stringDefaultt('select.searchLabel') ('Search options') | Accessible label used by the search input rendered inside the popover. Falls back to the localized Names the in-panel search field, which defaults to the localized "Search options". It is not the trigger's name: that is the |
selectable Type: boolean | ((item: Item) => boolean)Defaulttrue | Defines whether options are selectable. Can be a global boolean that affects all options or a function that accepts an item and returns a boolean that only affects that item. Non-selectable options are rendered disabled. |
stash Type: booleanDefaultfalse | Keeps picked options named across searches: a pick stays resolvable when a later search or a failed load no longer returns it. It follows the model, and does not keep a pick valid: Keeps picked options resolvable across searches. It does not help a trigger label, which should never depend on what the component has loaded. See example |
transitionDuration Type: numberDefault250 | Transition duration (ms) for popover show/hide animations. |
width Type: string | numberDefault"200" | Width of the popover: a bare number or Defaults to |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
highlighted Type: unknown | |
modelValue Type: any | Holds a single value, or an array under |
open Type: boolean | |
query Type: string |
Events
| Name | Description |
|---|---|
active Type: (value: any): void | Emitted when the component becomes active (focus enters it), with the current value. |
blur Type: (event: FocusEvent): void | Emitted when the activator loses focus. |
change Type: (event: Event): void | Emitted when the value changes via native change event. |
click Type: (event: MouseEvent): void | Emitted when the activator is clicked. |
focus Type: (event: FocusEvent): void | Emitted when the activator receives focus. |
hide Type: (): void | Emitted as soon as the options surface starts to close. |
inactive Type: (value: any): void | Emitted when focus moves outside the entire component after it was active, with the current value, whether or not it changed. React on this, not on |
input Type: (event: Event): void | Emitted on native input events from the search input. |
option:add Type: (text: string): void | Emitted when the user types a new value and confirms it (Enter key) while writing is enabled (i.e. |
show Type: (): void | Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone). |
shown Type: (): void | Emitted once the options surface is open and its open transition has finished. |
update:highlighted Type: (value: unknown): void |
|
update:modelValue Type: (value: any): void | Emitted with the next selection value whenever selection changes. |
update:open Type: (value: boolean): void | The panel opened or closed ( |
update:query Type: (value: string): void |
|
value-commit Type: (value: any): void | Emitted once the user finishes changing the value, after the last |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
activator Type: BbSelectPopoverActivatorSlotProps | Replaces the default trigger element that opens the select popover. Spread |
empty Type: { query: string; focus: () => void; close: () => Promise<void>; } | Content shown when no options match the query or the list is empty. Empty only: a failed load shows the library's failure row instead (its message is |
footer Type: BbSelectPopoverPanelSlotProps | Content pinned to the bottom of the panel, below the options list. Rendered in both the desktop popover and the adaptive sheet. Renders below the options list in the desktop popover and the mobile sheet alike. Your trigger is not a form field, so it has no clear button of its own; |
group Type: BbSelectPopoverGroupSlotProps<Item> | Replaces the default group header rendered above grouped options. Not called for rows with no group ( |
header Type: BbSelectPopoverPanelSlotProps | Content pinned to the top of the panel, above the search field. Rendered in both the desktop popover and the adaptive sheet. Renders above the search field. On a trigger with no label, a title here is often the only place the panel says what it is for. See example |
loading Type: { query: string; } | Content shown inside the options dropdown while items are loading. |
option Type: BbSelectPopoverOptionSlotProps<Item, Known> | Replaces the default rendering of each option row in the dropdown. With |
option:append Type: BbSelectPopoverOptionSlotProps<Item, Known> | An option's trailing region, as |
option:prepend Type: BbSelectPopoverOptionSlotProps<Item, Known> | An option's leading region, with the |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
allowWritingdisableWritingfails silentlyarrowPaddingremovedfails silentlyflipdisableFlipfails silentlyhasWarninghasWarningsfails silentlyhideArrowremovedfails silently- 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; BbSelect inherits this. showArrowremovedfails silently