Skip to content

Select Group

An enterprise-class grouped select component built on top of Radix Vue's Combobox, supporting grouping, multiple selection, searching, and group-level select all.

Features

  • 📦 Grouped Display: Supports data grouping, with collapsible capabilities.
  • Multiple & Select All: Supports multiple selection mode and group-level one-click select all/deselect all.
  • 🔍 Local Search: Built-in local search filtering for quick option finding.
  • 📋 Form Integration: Perfectly integrates with BrForm, supporting complex validation rules like required and quantity limits.
  • 🎨 Theming: Supports global theme customization via BrConfigProvider.

Basic Usage

Basic single selection with group collapsible functionality.

Example

Multiple & Select All

Supports multiple selection mode. Enable show-group-select-all to allow one-click select all/deselect all operations in the group header.

Example

Search & Filter

Enable the filterable attribute to support local search filtering for options.

Example

Form Integration

Typical application within a form, supporting data validation combined with BrForm.

Example

API Reference

BrSelectGroup

PropertyTypeDefaultDescription
modelValue (v-model)string | number | (string | number)[]-The binding value
defaultValuestring | number | (string | number)[]-The default value
optionsSelectGroupItem[][]Data source options
disabledbooleanfalseWhether the entire select is disabled
placeholderstring'Please select'Placeholder text
size'sm' | 'default' | 'lg''default'Component size
errorbooleanfalseWhether it is in an error state
clearablebooleanfalseWhether to show a clear button
filterablebooleanfalseWhether local search filtering is enabled
multiplebooleanfalseWhether multiple selection mode is enabled
loadingbooleanfalseWhether it is in a loading state
emptyTextstring'No data'Text to display when no data matches
showGroupSelectAllbooleanfalseWhether to show the group-level select all button (valid only in multiple mode)
collapsiblebooleanfalseWhether groups are allowed to collapse
zIndexnumber-The z-index of the popover

SelectGroupItem (Options)

PropertyTypeDefaultDescription
groupstring-Group name
disabledbooleanfalseWhether the group is disabled
collapsiblebooleanfalseWhether this group is allowed to collapse (higher priority than global config)
collapsedbooleanfalseWhether it is collapsed by default upon initialization
optionsSelectGroupOptionType[][]List of options within the group

SelectGroupOptionType

PropertyTypeDefaultDescription
labelstring-Option display text
valuestring | number-Value binding of the option
disabledbooleanfalseWhether the option is disabled

Emits

Event NameCallback ParametersDescription
change(value: string | number | (string | number)[] | undefined)Triggered when the selected option changes
clear()Triggered when the clear button is clicked
search(query: string)Triggered when the search keyword changes
group-toggle(group: string, collapsed: boolean)Triggered when the group collapsible state changes