Skip to content
Slotted

Multi-select

A text field that collects several values as removable tags, filtering a list of options as the reader types.

Chai tea, 24 bags is reordered at each of these warehouses.

Installation

The packages are a 0.x beta on npm, and their public API changes between beta releases without deprecation. One line installs the binding and the default theme.

bash
pnpm add @slotted/react @slotted/theme @slotted/themes
tsx
import { MultiSelect, MultiSelectContent, MultiSelectControl,  MultiSelectGroup, MultiSelectItem, MultiSelectSeparator } from '@slotted/react';

Initial value

defaultValue in React and a one-way [value] in Angular set the values the control starts with, in the order the tags are drawn. Pass items, the list of values and labels, whenever the control starts with values: in React the options are rendered only while the list is open, so without items a tag shows its raw value, such as RNO, until the list first opens.

Reno, NVColumbus, OH

Earl Grey, 100 bags is stocked at two warehouses.

Sizes

size sets the control to one step of the control scale: sm for toolbars and dense tables, md for most forms, lg for sparse forms. An empty multi-select is the height of a text field of the same size; each row of tags adds to it. Inside a field, an unset size follows the field.

Reno, NVColumbus, OH
Reno, NVColumbus, OH
Reno, NVColumbus, OH

Variants

outline is the default frame. subtle fills the control, for a form on a tinted surface. plain draws no frame at rest, for a table cell, and still shows hover and focus.

Web storeWholesale
Web storeWholesale
Web storeWholesale

States

Set invalid, readOnly and disabled on the field, which passes them to the multi-select; each can also be set on the multi-select itself. Invalid draws the border and the focus ring in the danger tone and sets aria-invalid on the input. Read-only keeps the tags legible and the input focusable, and removes the remove buttons, the clear button and the list. Disabled does the same and takes the control out of the tab order.

Error:Choose at least one warehouse before publishing.

Reno, NVSavannah, GA

Updated by the nightly inventory sync.

Columbus, OH

Transfers open once the purchase order is received.

Groups

MultiSelectGroup in React and sl-multi-select-group in Angular put a run of options under a heading, which assistive technology reads with each option. MultiSelectSeparator and sl-multi-select-separator draw a line between runs. A group whose options were all filtered away disappears with its heading: type dallas to see only Central.

Reno, NVSavannah, GA

Icons and descriptions

icon fills the first column of an option and description writes a second line under its label. In React icon takes any element; in Angular it names a glyph. The filter compares the label only.

Invoice

Disabled options

A disabled option stays in the list, is announced as unavailable, and is skipped by every movement key. Put the reason in its description, so the reader knows why it cannot be chosen.

Reno, NV

Filtering

Typing filters the list. The default comparison is a locale-sensitive “contains” that ignores accents and case, so malmo finds Malmö, and the matched span is marked. locale sets the language of the comparison when it differs from the page; highlightMatch={false} turns the mark off. Choosing an option empties the typed text and keeps the list open for the next value.

Type “zur” or “malmo”: accents and case are ignored.

Limiting the number of values

max caps the set. A counter such as 2 of 3 sits in the control while max is set. At the limit the counter changes tone, the root carries data-complete, every option not yet chosen is announced as unavailable, and a live message says the limit was reached. Removing a tag frees a place again.

BeveragesConfections

The storefront home page shows up to three categories.

Overflow

overflow="wrap", the default, keeps every tag in view: the control grows by whole rows up to three, then scrolls inside its frame. overflow="collapse" keeps the control one row high and counts the tags that do not fit in a +N tag; pressing it opens the list, whose top band lists every chosen value.

Reno, NVOntario, CAKent, WADallas, TXJoliet, ILColumbus, OHSavannah, GA

Wrap: every chip stays in view, up to three rows.

Reno, NVOntario, CAKent, WADallas, TXJoliet, ILColumbus, OHSavannah, GA

Collapse: one row, and a count of the rest.

Creating values

With creatable, text the list does not hold becomes a value. Once nothing in the list matches, the list offers to add the text; Enter, a comma or leaving the control commits it. delimiters sets the characters that commit, and commitOnBlur={false} keeps the text when focus leaves. A value already in the set is refused, compared without regard to case or accents, and focus moves to the tag that holds it.

chaiblack tea

Type a keyword and press Enter or a comma. Shoppers find Chai tea, 24 bags by these words.

Pasting and validating typed values

A paste that contains delimiters becomes several values at once; addOnPaste={false} keeps it as text. validateValue decides whether typed text may become a value. Every value turned away, by the predicate, as a duplicate or over max, is reported through onValueRefuse in React and (valueRefuse) in Angular with its cause, so the page can say why. Paste buyers@northwind.example, not-an-address to see both outcomes.

purchasing@northwind.example

Paste a list separated by commas, semicolons or spaces.

Editing a value in place

With editable, Enter on a focused tag turns it into a text field holding its value. Enter commits the change as one update and Escape restores the original. ArrowLeft from the start of the input, or Backspace from an empty input, reaches the last tag.

A-12-03A-12-04C-02-11

Press ArrowLeft to reach a bin, then Enter to correct it in place.

Controlled

Pass value and update it from onValueChange when other parts of the screen depend on the set; in Angular, bind [(value)] to a signal. The value is an array in the reader’s order. The request carries the reason: select from the list, submit from typed text, remove for one tag, clear for all of them, and keyboard for a reorder. In Angular the reason arrives through (valueChangeRequest).

Reno, NVColumbus, OH
Stocked at Reno, NV; Columbus, OH

Clearing

The clear button appears while the control holds tags or typed text. It empties both under the reason clear and returns focus to the input. clearable={false} removes the button, so tags come off one at a time. Escape never clears the set: it closes the list, or empties the typed text when the list is closed.

Web storeMarketplacePhone orders

The clear button empties the filter in one press.

Web storeWholesale

No clear button: channels come off one at a time.

Loading options

Set loading while options are on their way. The chevron becomes a spinner, the list shows three placeholder rows, and a status row announces the loading message. Here the options are requested the first time the list opens, from onOpenChange in React and (openChange) in Angular.

Carriers load from the rates service when the list opens.

Searching on the server

filter={null} turns the built-in filter off, for options a server has already filtered. Send the typed text to the server from onInputValueChange in React or (inputValueChange) in Angular, render what comes back, and set loading while the request runs. Tags keep their labels when a later search no longer returns their options. The empty message replaces “No matches” when nothing comes back.

Long lists

The list is never taller than the space the viewport leaves for it, and scrolls inside. PageDown and PageUp move the highlight ten options, and the list scrolls to the highlighted option without moving the page. chosenOptions="hide" takes chosen options out of the list, which suits a long list where the tags already show what was chosen.

CaliforniaNevadaOregon

Ground shipping from Reno, NV reaches these states in two days.

In a form

In React, name renders one hidden input per value under the same name, so FormData.getAll reads the set and a native reset restores defaultValue. In Angular, the multi-select is a form control: formControlName, formControl and ngModel bind the array, and its own validator reports required, tooMany past max and duplicate, with no validator to write. Submit without a warehouse to see the error, then reset.

Error:

Web store

Narrow controls

Under 120 pixels there is no room for a tag, and the control shows a count such as 3 chosen instead; the count ends in an ellipsis when the clear button and the chevron leave too little room for it, and the grid still announces it whole. width="content" lets the list grow past a narrow control, so labels keep their length.

Web storeMarketplaceWholesale

Keyboard and reordering

The multi-select is one tab stop. ArrowLeft from the start of the input reaches the last tag; from there ArrowLeft and ArrowRight walk the tags, Delete removes the focused tag, and any character returns to the input and types there. Backspace from an empty input first moves to the last tag and removes nothing; a second press removes it. With reorderable, Alt with ArrowLeft or ArrowRight moves the focused tag one place and Alt with Home or End moves it to either end; the move is reported with the reason keyboard and announced with the new position.

USPS Priority MailUPS GroundFedEx Ground

Rates are requested from the first carrier, then the next. Alt with an arrow moves the focused carrier.

Defaults for a section

MultiSelectDefaultsProvider in React and provideMultiSelectDefaults in Angular set any axis once for every multi-select under them, such as size, variant and overflow for a filter panel. A value set on one multi-select still wins.

Lucía FernándezKenji Watanabe
Wholesale

Filters above a table

Two compact multi-selects filter the rows of an orders table. overflow="collapse" keeps each filter one row high, each option’s description shows how many orders it matches, and an empty filter means every value. Outside a field, aria-label names each control.

OpenDelayed
5 of 8 orders
OrderCustomerStatusChannelTotal
SO-10482Harbor & PineOpenWeb store$1,240.00
SO-10485Verde KitchenDelayedWeb store$86.00
SO-10487Atlas FreightOpenWholesale$1,912.00
SO-10488Lumen DentalOpenWeb store$472.80
SO-10489Cobalt OutfittersDelayedMarketplace$1,055.40

Tagging orders in a table

A plain, compact, creatable multi-select in each row holds that order’s tags. variant="plain" draws no frame inside the cell, overflow="collapse" keeps the row one line high, and a new tag is typed and committed in place.

OrderCustomerTags
SO-10482Harbor & Pine
priorityfragile
SO-10483Brightline Studio
address check
SO-10484Northgate Labs
wholesalebackorderpriority
SO-10485Verde Kitchen

Choosing table columns

A reorderable multi-select decides which columns the table shows and in which order. “Show all” sets the whole list as the value, which is how a select-all is composed: the multi-select has no built-in one, because only the page knows what “all” means under a filter or a limit.

OrderCustomerTotal

The table follows the order of the chips. Alt with an arrow moves a focused column.

OrderCustomerTotal
SO-10482Harbor & Pine$1,240.00
SO-10483Brightline Studio$318.50
SO-10484Northgate Labs$2,906.10

Accessibility

KeyEffectFocus
ArrowDownclosed, opens and highlights the first option; open, moves the highlight to the next option, wrapping only when loop is truestays on the input, and the caret does not move
ArrowUpclosed, opens and highlights the last option, which is the pattern's optional Up Arrow; open, moves the highlight to the previous optionthe input, caret unmoved
Alt+ArrowDownopens the popup without moving the highlightthe input
Alt+ArrowUpcloses the popupthe input
Enterwith a highlight, toggles that option, empties the query and leaves the popup open; with no highlight, an offer drawn and creatable set, commits the typed text as a value; on a chip with editable set, opens or commits the chip's fieldthe input, or the chip's cell while it is being edited
Escapeopen, closes and keeps the typed text; closed, clears the typed text; on a chip, returns to the input; while a chip is being edited, reverts it. It never clears the selectionthe input
Homeon the input, the browser's caret movement, never intercepted, which is the pattern's editable branch; on a chip, moves to the first cellthe input with the caret at the first character, or the first chip
Endon the input, the browser's caret movement, never intercepted; on a chip, moves to the last cell, which is the inputthe input with the caret after the last character
PageDownmoves the highlight ten options down, which is PAGE_STEP from the collection enginethe input
PageUpmoves the highlight ten options upthe input
ArrowLefton the input, the browser's caret movement while the caret has anywhere to go; from the start of the query it moves to the previous cell, which under dir=rtl is the next one. On a chip, moves one cellthe input or a chip's cell
ArrowRighton the input, the browser's caret movement while the caret has anywhere to go; from the end of the query it moves to the next cell, which under dir=rtl is the previous one. On a chip, moves one cellthe input or a chip's cell
Alt+ArrowLeftwith reorderable set, moves the focused value one place toward the start of the row, and toward the end under dir=rtlstays on the moved chip, which has changed cell
Alt+ArrowRightwith reorderable set, moves the focused value one place toward the end of the row, and toward the start under dir=rtlstays on the moved chip
Alt+Homewith reorderable set, moves the focused value to the start of the rowstays on the moved chip
Alt+Endwith reorderable set, moves the focused value to the end of the rowstays on the moved chip
Backspaceon the input with a query, the browser's own deletion; on the input with an empty query and the caret at the start, the first press moves focus to the last chip and removes nothing and the second press removes it; on a chip, removes that valuethe last chip, then the chip that took the removed one's index, then the previous chip, then the input
Deleteon a chip, removes that value; on the input, the browser's own deletionthe chip that took the removed one's index, then the previous chip, then the input
Delimiterany character in the delimiters axis commits the typed text as a value and is never typed into the inputthe input
Printable characteron the input, types and filters; on a chip, returns focus to the input and types it there, which is the grid pattern's alphanumeric branchthe input
Tableaves the control. With commitOnBlur set, the pending text is committed first. The popup, the chips and the remove buttons are outside the tab sequence, which the combobox pattern requires of a popup and the grid pattern of a layout gridthe element beside the control in the document's order
  • The input is the tab stop of the control. The tags, their remove buttons and the trigger carry tabindex="-1", as the combobox and grid patterns ask; the clear button, while it is drawn, is in the tab order.
  • The tags are a layout grid with one row, which leaves ArrowDown and ArrowUp to the list. Focus lands on a tag rather than on its remove button, and Delete and Backspace do what the button does. The grid carries the number of chosen values as its name.
  • The list sets aria-multiselectable, and selection does not follow the highlight: moving through the options chooses nothing until Enter or a press. This departs from the note in the combobox pattern, as every implementation surveyed does.
  • Changes are announced as well as drawn: a value added with the count now held, a value removed with its label and the count left, a value moved with its new position, and the limit when it is reached. The status row announces how many options match the query.

API

multi-select

Props

valuereadonly string[]
The chosen values, in the order the reader chose them. Controlled.
defaultValuereadonly string[]
The values an uncontrolled multi-select starts with, read once. A reset of the form it belongs to returns to them.
inputValuestring
The text in the input. It is emptied whenever a value is committed. Controlled.
defaultInputValuestring
The text an uncontrolled input starts with, read once.
openboolean
Whether the list is open. Controlled.
defaultOpenboolean
Whether an uncontrolled list starts open.
highlightedValuestring | null
The option the highlight is on, which is not a chosen option. Controlled.
defaultHighlightedValuestring | null
Where an uncontrolled highlight starts.
itemsMultiSelectItems
Values and labels declared up front, so a tag shows its label before the list has rendered its options.
filterMultiSelectFilter
Compares an option label with the query. When absent, the comparison is a locale-sensitive "contains" that ignores case and accents; null turns filtering off for options a server has already filtered.
localestring
The BCP 47 language of the filter and of the duplicate comparison. When absent, the language in force.
validateValue(text, values) => boolean
Whether typed text may become a value. Text it turns down is reported through onValueRefuse with the cause invalid.
namestring
The submission name. One hidden input per value carries it.
formstring
The id of the form the hidden inputs belong to, for a multi-select rendered outside it.
totalnumber
The number of options in the whole collection, for aria-setsize on a windowed list.
maxnumber | nullDefault null
The most values the set may hold; null means no limit. At the limit, every option not yet chosen is announced as unavailable.
delimitersreadonly string[]Default ,
The characters that commit the typed text and split a paste. One list serves both.
creatablebooleanDefault false
Whether typed text may become a value.
editablebooleanDefault false
Whether Enter on a focused tag turns it into a text field.
reorderablebooleanDefault false
Whether Alt with ArrowLeft, ArrowRight, Home or End moves the focused tag along the row.
allowDuplicatesbooleanDefault false
Whether the same value may be held twice.
addOnPastebooleanDefault true
Whether a paste that contains delimiters becomes several values.
commitOnBlurbooleanDefault true
Whether typed text is committed when focus leaves the control.
overflow'wrap' | 'collapse'Default wrap
What the control does with more tags than fit: wrap grows by rows up to three, then scrolls; collapse keeps one row and counts the rest in a +N tag.
chosenOptions'show' | 'hide'Default show
Whether a chosen option stays in the list with a check, or leaves it.
clearablebooleanDefault true
Whether the clear button is drawn while the control holds a value or typed text.
closeOnSelectbooleanDefault false
Whether choosing an option closes the list. Off by default, because a set is built with several choices.
closeOnEscapebooleanDefault true
Whether Escape closes the list.
closeOnOutsidePressbooleanDefault true
Whether a press outside the list closes it.
loopbooleanDefault false
Whether the highlight wraps from the last option to the first, and back.
highlightMatchbooleanDefault true
Whether the span the query matched is marked.
size'sm' | 'md' | 'lg'Default md
The step of the control scale. Inside a field, an unset size follows the field.
variant'outline' | 'subtle' | 'plain'Default outline
The frame: outline draws an edge, subtle a filled ground, plain neither until hover or focus.
side'bottom' | 'top' | 'inline-start' | 'inline-end' | 'left' | 'right'Default bottom
The side of the control the list opens on.
align'start' | 'center' | 'end'Default start
How the list aligns along that side.
width'anchor' | 'content'Default content
content keeps the list at least as wide as the control and widens it to its longest option; anchor pins it to the width of the control.
mount'active' | 'lazy' | 'eager'Default active
When the list exists in the DOM: only while open (active), from the first open on (lazy), or from the start (eager).
strategy'absolute' | 'fixed'Default absolute
The CSS position the list uses.
openOn'input' | 'focus' | 'manual'Default input
Which gestures open the list besides the trigger and the arrow keys: typing or a press on the input (input), also any focus on the input (focus), or none, so typing filters without opening (manual).
sideOffsetnumberDefault 4
The distance in pixels between the control and the list.
alignOffsetnumberDefault 0
The shift in pixels along the aligned edge.
collisionPaddingnumberDefault 8
How close in pixels the list may come to the edge of the viewport before it moves.
flipbooleanDefault true
Whether the list moves to the opposite side when it does not fit.
shiftbooleanDefault true
Whether the list slides along its side to stay in view.
hideWhenDetachedbooleanDefault true
Whether the list hides when the control scrolls out of its clipping container.
portalbooleanDefault true
Whether the list is portalled to the end of the document.
fullWidthbooleanDefault true
Whether the control fills the width of its container.
disabledbooleanDefault false
Whether the control is disabled: it takes no input, draws no remove buttons and leaves the tab order.
readOnlybooleanDefault false
Whether the values can be read and copied but not changed. The input stays focusable; the list, the remove buttons and the clear button are withheld.
requiredbooleanDefault false
Whether an empty set is invalid.
invalidbooleanDefault false
Whether the control is drawn in the error state, with aria-invalid on the input.
loadingbooleanDefault false
Whether options are on their way: the spinner replaces the chevron and the list shows placeholder rows.
messagesPartial<MultiSelectMessages>
Replaces any of the phrases the multi-select writes: clear, trigger, chosen ({count}), count ({count}), counter ({count}, {max}), create ({query}), empty, loading, remove ({label}) and reorder ({label}, {position}, {count}). Phrases left out come from the language in force.
render(props) => ReactNode
On MultiSelectControlReplaces the frame element. The props it receives include the ref that measures the frame for the narrow layout, which the replacement has to keep.
chosenbooleanDefault true
On MultiSelectContentWhether the band of chosen values is drawn at the top of the list.
emptyReactNode
On MultiSelectContentWhat the list shows when no option matches, in place of the empty message.
statusReactNode
On MultiSelectContentWhat the live region says, in place of the number of matching options.
valuestring
On MultiSelectItemThe key of the option, which is what enters the set.
disabledbooleanDefault false
On MultiSelectItemWhether the option can be chosen.
descriptionReactNode
On MultiSelectItemA second line under the label.
iconReactNode
On MultiSelectItemAny element, drawn in the first column of the option.
textValuestring
On MultiSelectItemThe text the filter compares, for an option whose children are not plain text.
positionnumber
On MultiSelectItemThe place of the option in a windowed collection, for aria-posinset.
labelReactNode
On MultiSelectGroupThe name of the group.

Events

NamePayloadWhen
onValueChange(value: readonly string[], request: ChangeRequest<readonly string[]>)Before the set changes. request.reason is select for an option, submit for typed text, remove for one value, clear for all of them, keyboard for a reorder, and programmatic for the handle and for a form reset. request.cancel() refuses the change.
onValueRefuse(values: readonly string[], details: { cause: "duplicate" | "limit" | "invalid" })Values were turned away, and details.cause says why. Nothing is held and nothing can be cancelled: the values never entered the set.
onInputValueChange(value: string, request: ChangeRequest<string>)Before the typed text changes. request.reason is keyboard while typing, select or submit when a commit empties it, clear for Escape or the clear button, blur when leaving the control commits it, and programmatic for a form reset.
onOpenChange(open: boolean, request: ChangeRequest<boolean>)Before the list opens or closes. request.reason is pointer, keyboard, escape, outsidePress, select, dismiss, blur or programmatic.
onHighlightedValueChange(value: string | null, request: ChangeRequest<string | null>)Before the highlight moves. request.reason is pointer, keyboard or programmatic. Moving the highlight chooses nothing.
onLoadMore()The last option scrolled into view, so the next page can be fetched.

Composition

MultiSelectDefaultsProvidercomponent
On ApplicationSets any axis once for every multi-select below it. The words come from the language in force, set by SlottedProvider. A prop set on one multi-select still wins.
render(props) => ReactNode
On MultiSelectControl, MultiSelectContentOn MultiSelectControl, replaces the frame and receives the ref that measures it; a replacement that drops the ref loses the narrow layout. On MultiSelectContent, replaces the layer and receives its attributes and the options.
refRef<MultiSelectHandle>
focus(), open(), close(), scrollToKey(value) and setValue(values, reason): the actions a prop cannot express.
native propsComponentPropsWithRef
On MultiSelectControl, MultiSelectContentProps written on MultiSelectControl reach the input, such as aria-label and placeholder; props written on MultiSelectContent reach the listbox. On the input, your onKeyDown, onChange, onClick, onFocus, onBlur and onPaste run first, and calling preventDefault stops the multi-select from handling that event.
data-*attributes
On every partEvery state is an attribute to style: data-open, data-disabled, data-readonly, data-invalid, data-required, data-loading, data-selected, data-current and data-complete.

Parts

PartElementRequiredPurpose
rootdiv, rendered by MultiSelectControlYesThe frame, carrying data-ui="multi-select". It draws the border, the shadow, the focus ring and every state. Its height is not fixed: it grows by whole rows of tags up to three, then scrolls.
controldiv with role="grid"YesThe layout grid that holds the tags and the field, as the APG grid pattern describes for a list of message recipients. Its aria-label carries the number of chosen values, such as "2 chosen".
chipsdiv with role="row"YesOne row in the DOM, however many lines it wraps to. The wrap is CSS, so the reading order stays linear and ArrowDown and ArrowUp stay with the list. Past three rows it scrolls, and it draws no scrollbar inside the frame.
fieldspan with role="gridcell"YesThe last cell of the row, holding the input. It wraps with the tags instead of moving to a line of its own, and it takes the width of a word with a floor of two characters.
inputinput with role="combobox"YesA native text input, so text editing, the caret, selection, IME and autofill work as in any input. It is the tab stop of the control and carries aria-expanded, aria-controls and aria-activedescendant.
counterspanNoThe number of values against max, such as "2 of 3", or the number chosen while the frame is too narrow for a tag. It is drawn only in those two cases.
busyspanNoThe spinner that stands in place of the chevron while loading is set, because the list has nothing to open onto yet.
clearbuttonNoRemoves every value and the typed text at once, under the reason clear. It is drawn while clearable is set and the control holds a value or typed text.
triggerbuttonYesOpens and closes the list with the pointer. It carries tabindex="-1", because the combobox pattern keeps the popup indicator out of the tab sequence.
arrowspanYesThe chevron inside the trigger, a Glyph inside an Icon box, turned over while the list is open.
positionerdiv, rendered by MultiSelectContentYesThe layer, portalled to the end of the document. It carries data-ui="multi-select" as well, so the stylesheet reaches the list outside the root.
contentdiv with role="listbox" and aria-multiselectableYesThe list surface. Selection does not follow the highlight: moving through the options chooses nothing, which departs from the combobox pattern on purpose.
chosendivNoEvery chosen value as a tag, at the top of the list, whatever the row in the control shows. With overflow="collapse", the values the +N tag counts stay readable here.
groupdiv with role="group"NoA run of options under a name. A group whose options were all filtered away is hidden with its heading, so a heading never claims a match.
group-labeldivNoThe name of a group, which the group references with aria-labelledby.
itemdiv with role="option"YesOne option. It compares its own label with the query and is hidden when it does not match. Pressing an option already chosen removes its value.
indicatorspanYesThe check on a chosen option, and the plus on the option that adds the typed text.
iconspanNoThe first column of an option, for an icon that makes rows recognizable.
labelspanYesThe text the reader chooses by, clamped to two lines. Its rules apply inside the option only, so the label of a tag keeps its own.
matchmark, the match part of the highlight component, inside labelNoThe span of the label the query matched, drawn by the highlight stylesheet, so every filtered list marks a match the same way.
descriptionspanNoA second line under the label of an option, for detail the label has no room for.
separatordiv with role="separator"NoA line between two runs of options.
emptydivNoThe message shown when no option matches. It keeps the width of the list, so nothing shifts when results arrive.
statusdiv with role="status"YesThe live region, and the loading row. It announces how many options match the query.
placeholderdiv holding skeleton rowsNoRows the height of an option, standing in for the options while they load. Hidden from assistive technology, because the status row announces the wait.

Theming

Each token is a CSS custom property: set it in a theme, or on any element to retune every multi-select inside it.

Multi-select tokens

TokenDefault
--slotted-multi-select-action-active-backgroundvar(--slotted-tone-secondary-subtle-active)
--slotted-multi-select-action-colorvar(--slotted-text-muted, GrayText)
--slotted-multi-select-action-hover-backgroundvar(--slotted-tone-secondary-subtle-hover)
--slotted-multi-select-action-sizemin(calc(var(--_icon-size) + 2 * var(--slotted-space-2, 0.25rem)), var(--_inner-size))
--slotted-multi-select-arrow-colorvar(--slotted-text-muted, GrayText)
--slotted-multi-select-autofill-backgroundvar(--slotted-tone-accent-surface)
--slotted-multi-select-backgroundvar(--slotted-control-surface, Field)
--slotted-multi-select-border-colorvar(--slotted-control-border-color, ButtonBorder)
--slotted-multi-select-colorvar(--slotted-text, CanvasText)
--slotted-multi-select-content-border-colorvar(--slotted-border-subtle, #e2e8f0)
--slotted-multi-select-content-padding-blockvar(--slotted-space-2, 0.25rem)
--slotted-multi-select-content-padding-inlinevar(--slotted-space-2, 0.25rem)
--slotted-multi-select-content-radiusvar(--slotted-radius-lg, 8px)
--slotted-multi-select-content-shadowvar(--slotted-shadow-md)
--slotted-multi-select-content-textvar(--slotted-text, #0f172a)
--slotted-multi-select-content-text-mutedvar(--slotted-text-muted, #5b6b7f)
--slotted-multi-select-counter-colorvar(--slotted-text-muted, GrayText)
--slotted-multi-select-counter-complete-colorvar(--slotted-tone-accent-text)
--slotted-multi-select-disabled-backgroundvar(--slotted-disabled-background)
--slotted-multi-select-disabled-border-colorvar(--slotted-disabled-border)
--slotted-multi-select-disabled-colorvar(--slotted-disabled-foreground)
--slotted-multi-select-field-basis4rem
--slotted-multi-select-field-min2.5rem
--slotted-multi-select-group-label-heightcalc( var(--_secondary-font-size) * var(--slotted-line-height-sm, 1.45) + 2 * var(--slotted-space-2, 0.25rem) )
--slotted-multi-select-highlightvar(--slotted-tone-secondary-subtle-active)
--slotted-multi-select-highlight-activevar(--slotted-tone-accent-surface)
--slotted-multi-select-highlight-ringvar(--slotted-tone-accent-border)
--slotted-multi-select-hover-border-colorvar(--slotted-tone-accent-border)
--slotted-multi-select-icon-size-min14px
--slotted-multi-select-invalid-border-colorvar(--slotted-tone-danger-border)
--slotted-multi-select-invalid-edge-widthvar(--slotted-control-invalid-edge-width, 1px)
--slotted-multi-select-invalid-focus-ring-colorvar(--slotted-focus-ring-color-invalid, Highlight)
--slotted-multi-select-item-radiusmax(0px, calc(var(--_radius) - var(--_inset-inline)))
--slotted-multi-select-measure24rem
--slotted-multi-select-open-border-colorvar(--slotted-tone-accent-border)
--slotted-multi-select-placeholder-colorvar(--slotted-text-muted, GrayText)
--slotted-multi-select-plain-hover-backgroundvar(--slotted-tone-secondary-subtle-hover)
--slotted-multi-select-radiusvar(--slotted-control-radius, 4px)
--slotted-multi-select-readonly-backgroundvar(--slotted-tone-secondary-subtle-hover)
--slotted-multi-select-selected-colorvar(--slotted-tone-accent-text)
--slotted-multi-select-separator-colorvar(--_border-color)
--slotted-multi-select-shadowvar(--slotted-control-shadow, none)
--slotted-multi-select-subtle-backgroundvar(--slotted-surface-sunken, Canvas)
--slotted-multi-select-subtle-border-colorvar(--slotted-border-subtle, ButtonBorder)
--slotted-multi-select-subtle-hover-backgroundvar(--slotted-tone-secondary-subtle-hover)
--slotted-multi-select-surfacevar(--slotted-surface-raised, #ffffff)

Theme tokens it reads

TokenDefault
--slotted-border-subtleSet per scheme by the theme
--slotted-border-width-thin1px
--slotted-control-border-colorSet per scheme by the theme
--slotted-control-border-widthvar(--slotted-border-width-thin)
--slotted-control-focus-ring-offsetvar(--slotted-focus-ring-offset)
--slotted-control-font-familyvar(--slotted-font-family-sans)
--slotted-control-font-size-lgcomfortable 14px · compact 13px · dense 12px
--slotted-control-font-size-mdcomfortable 13px · compact 12px · dense 12px
--slotted-control-font-size-smcomfortable 12px · compact 12px · dense 12px
--slotted-control-gap-lgcomfortable 8px · compact 6px · dense 6px
--slotted-control-gap-mdcomfortable 8px · compact 6px · dense 4px
--slotted-control-gap-smcomfortable 6px · compact 4px · dense 4px
--slotted-control-height-lgcomfortable 38px · compact 32px · dense 30px
--slotted-control-height-mdcomfortable 34px · compact 28px · dense 26px
--slotted-control-height-smcomfortable 30px · compact 26px · dense 24px
--slotted-control-icon-size-lgcomfortable 18px · compact 16px · dense 14px
--slotted-control-icon-size-mdcomfortable 16px · compact 14px · dense 13px
--slotted-control-icon-size-smcomfortable 14px · compact 13px · dense 12px
--slotted-control-inner-size-lgcomfortable 28px · compact 24px · dense 22px
--slotted-control-inner-size-mdcomfortable 24px · compact 20px · dense 18px
--slotted-control-inner-size-smcomfortable 22px · compact 18px · dense 16px
--slotted-control-invalid-edge-widthvar(--slotted-border-width-thin)
--slotted-control-padding-inline-lgcomfortable 16px · compact 12px · dense 10px
--slotted-control-padding-inline-mdcomfortable 13px · compact 10px · dense 8px
--slotted-control-padding-inline-smcomfortable 10px · compact 8px · dense 6px
--slotted-control-radiusvar(--slotted-radius-sm)
--slotted-control-shadowSet per scheme by the theme
--slotted-control-shadow-focus-geometry0 1px 4px -1px
--slotted-control-surfaceSet per scheme by the theme
--slotted-control-transition-durationvar(--slotted-duration-short)
--slotted-control-transition-easingvar(--slotted-easing-standard)
--slotted-disabled-backgroundSet per scheme by the theme
--slotted-disabled-borderSet per scheme by the theme
--slotted-disabled-foregroundSet per scheme by the theme
--slotted-duration-medium200ms
--slotted-duration-short120ms
--slotted-easing-entercubic-bezier(0.05, 0.7, 0.1, 1)
--slotted-easing-exitcubic-bezier(0.3, 0, 0.8, 0.15)
--slotted-easing-standardcubic-bezier(0.2, 0, 0, 1)
--slotted-focus-ring-colorSet per scheme by the theme
--slotted-focus-ring-color-invalidSet per scheme by the theme
--slotted-focus-ring-offsetvar(--slotted-border-width-thick)
--slotted-focus-ring-widthvar(--slotted-border-width-thick)
--slotted-font-family-sans'Geist Variable', ui-sans-serif, system-ui, sans-serif
--slotted-font-size-xs0.75rem
--slotted-font-weight-medium500
--slotted-font-weight-semibold600
--slotted-line-height-md1.5
--slotted-line-height-sm1.45
--slotted-overlay-max-block-size100vh
--slotted-radius-lg8px
--slotted-radius-none0px
--slotted-shadow-mdSet per scheme by the theme
--slotted-space-10.125rem
--slotted-space-20.25rem
--slotted-space-50.75rem
--slotted-surface-raisedSet per scheme by the theme
--slotted-surface-sunkenSet per scheme by the theme
--slotted-target-comfortable44px
--slotted-target-min24px
--slotted-textSet per scheme by the theme
--slotted-text-mutedSet per scheme by the theme
--slotted-tone-accent-borderSet per scheme by the theme
--slotted-tone-accent-surfaceSet per scheme by the theme
--slotted-tone-accent-textSet per scheme by the theme
--slotted-tone-danger-borderSet per scheme by the theme
--slotted-tone-secondary-subtle-activeSet per scheme by the theme
--slotted-tone-secondary-subtle-hoverSet per scheme by the theme
--slotted-z-index-popover1100