Skip to content

BbSelect

A searchable form field for choosing one or many values from local or fetched options.

import { BbSelect } from 'bitboss-ui';

On this page

Use it for

Use BbSelect when a form needs a searchable choice from known values, such as an assignee, city, plan or set of labels. It owns the label, validation, selection display and options panel.

Use something else when

  • BbRadioGroup: a short exclusive choice should stay visible
  • BbCheckboxGroup: a short multiple choice should stay visible
  • BbTag: users invent values instead of choosing from a known set
  • BbDropdown: the rows run actions
  • BbSelectPopover: the trigger is a pill, badge or table cell instead of a form field

Pass Through

Hover or tap a part to outline it. Toggles flip loading, errors and warnings when the component has them — only parts highlight.

$HighHighUSDGuidance while the control is focused.

The field props follow BbTextInput. This page focuses on option data, search and selection.

Pick from application data

Pass domain objects unchanged, then set item-text and item-value; this keeps the raw object available to slots while the model stores a stable id.

Amara OkonkwoAmara Okonkwo

Model: 4 — the id, not the person.

Use selectable to disable individual options. An item-level disabled field is inert in v3, and duplicate resolved values are silently dropped.

Smallest useful select

For primitive items, a label, v-model and items are enough.

Choose a priorityChoose a priority

Model: null

Keep label meaningful even with hide-label; it is the combobox's accessible name. Add clearable when the value may be emptied.

Coming from v2

In single mode, clicking the selected option now keeps it selected and closes the panel; v2 emitted null. Multiple mode still toggles the option.

Form state and validation

Use the shared field props for guidance, required state and a clear action.

TeamTeamYearly billing saves 20%.

Errors make the field invalid; warnings keep it valid. Validate on inactive, not blur, because focus moves into the options panel during selection.

Required for invoicingRequired for invoicing
USDUSD
This account is billed in EUR. USD invoices are converted at payment.

name adds hidden form inputs. required marks the field but does not invoke native browser validation, so render required errors through your validation layer.

Coming from v2

An empty v3 selection omits the form field. v2 posted the string "null" in single mode. showChevron and #chevron are removed; use append:icon.

Multiple selection

Add multiple and seed the model as an array; any other initial shape throws.

MilanBerlinMilan, Berlin

2 of 3 chosen

max disables new choices at the limit while selected options remain removable. Use max-selected-labels for a predictable summary.

Ingrid HalvorsenNikhil RaghavanIngrid Halvorsen, Nikhil Raghavan

comma removes per-value close buttons. Use the chip slot when each selected value needs its own color, avatar or remove control.

accessibility performanceaccessibility, performance

Search matches display text by default. Set filter-by to search other fields; those paths replace the text match and must exist on every item.

Search a destinationSearch a destinationSearch by city or by country.

Provider results pass through the same local substring filter, so fuzzy server matches can disappear. Keep both matchers compatible.

Coming from v2allowWriting → disableWriting

filter-by now accepts only string[]. disable-writing replaces and inverts allow-writing; it also disables filtering and option:add. Short local arrays hide search automatically under autoDisableWritingThreshold (default 6).

Fetching options

Pass a provider to items for large lists. It receives (query, prefill, modelValue); on component-initiated calls, return the selected rows so their labels remain resolvable.

Type at least two letters to search the directory.

The component debounces typing, discards stale responses and owns fetch loading. Use stash only when selections must survive later result sets.

Coming from v2

prefill="focus" is now 'interaction'. prefill: false now means search-first; remove it to load on first open. Coherence also runs on the first load in v3.

null can represent an “All” option, but a provider then needs prefill: true because null also means empty. Use a sentinel such as 'all' when clearing, pruning and selecting everything must remain distinct.

All locationsAll locations

Filtering by: All locations

Dependent fields

List upstream values in dependencies, then enable enforce-coherence to remove a choice the refreshed options no longer contain.

ItalyItaly
MilanMilan

Model: milan

Multiple mode preserves still-valid choices instead of clearing the whole array.

Web appWeb app
Amara OkonkwoMei Lin ChenAmara Okonkwo, Mei Lin ChenOnly people on the project's teams can review.

On prefill === true, providers must return the current selection. An empty response can prune a valid model; stash avoids that but can also keep stale values coherent.

Panel actions

Use footer for actions over the model, such as select all, clear and done.

EmailEmail

Use header for context above search. Derive summaries from your model rather than selectedOptions, which is empty until provider data loads.

LisbonPortoLisbon, Porto
Coming from v2

header and footer replace options:prepend, options:append and their :outer variants.

Creating options

option:add reports the trimmed query; create the record, append it to items and select it in your handler. Guard the empty string.

accessibilityaccessibility

Custom option rows

Use group-by and the group slot for sections.

Pick a teammatePick a teammate

Use option for richer rows. Match taller markup with item-height and header-height; CSS-only heights break virtual scrolling.

Amara OkonkwoAmara Okonkwo

Grouped lists virtualize by group, so keep very large groups flat or split them.

Mobile behavior

Below the configured breakpoint, the panel becomes a bottom sheet by default. The same options, search, header and footer remain available.

ProcessingProcessing

Set adaptive only to override the global choice. Use off-canvas-props for sheet behavior and pt:sheet for sheet-only styling.

Sizing and styling

compact changes control and row density. Size the component with its wrapper; the panel follows the control width.

DesignDesign
EditorEditor

Use pt:panel for the visible options surface and pt:option for rows.

Coming from v2

Option classes moved from autocomplete-option* to bb-listbox__option*. --bb-select-option-px and --bb-select-option-py are removed. Set row heights with props, not CSS; the desktop panel remains inside the component subtree.