Skip to main content

Multi Select

A dropdown field for selecting multiple values from a list of options.

When to use it

Use MultiSelect<T> when a user needs to choose several options from a list, such as tagging an item with multiple categories. The options list accepts SelectOption entries and SelectDivider entries, which render as a thin horizontal separator between groups. Unlike Select, the dropdown stays open after a selection so users can toggle several options in one session — it closes only when the user taps outside it or taps the trigger again.

Import

import 'package:catalyst_ui/catalyst_ui.dart';

Usage

MultiSelect<String>(
label: 'Countries',
placeholder: 'Pick countries…',
value: _countries,
options: const [
SelectOption(
value: 'gb',
label: 'United Kingdom',
icon: MyIcons.flagGb,
),
SelectOption(value: 'us', label: 'United States'),
SelectDivider(),
SelectOption(value: 'ca', label: 'Canada'),
],
onChanged: (v) => setState(() => _countries = v),
)

Parameters

MultiSelect<T> is generic over the option value type T. It reuses the SelectOption<T>, SelectDivider<T>, SelectItem<T>, and SelectSize types defined alongside Select.

ParameterTypeDefaultDescription
labelString?nullAn optional label rendered above the trigger.
valueList<T>[]The currently selected values.
onChangedValueChanged<List<T>>?nullCalled with the full updated selection when the user toggles an option.
optionsList<SelectItem<T>>[]The list of items shown in the dropdown. May contain SelectOption entries and SelectDivider entries.
placeholderString?'Select…'Placeholder text when no value is selected.
disabledboolfalseWhen true, the field is non-interactive.
helperString?nullHelper text below the trigger.
errorString?nullWhen non-null, shows error styling with this message.
sizeSelectSizeSelectSize.mediumThe height variant.
trailingIconIconData?nullIcon to display at the end of the field. Falls back to Iconography.expandIcon.
checkIconIconData?nullIcon to display on selected options' checkboxes. Falls back to Iconography.checkIcon.

See the Select page for SelectOption and SelectDivider field details.

Sizes

SelectSize values: small (44px trigger), medium (48px, default), large (52px).

Iconography

  • The trailing expand icon uses trailingIcon, falling back to context.iconography.expandIcon, and rotates 180° when the dropdown is open.
  • Each option row renders a Checkbox whose checkIcon uses checkIcon, falling back to context.iconography.checkIcon.