StartFoundationsComponentsContent

Multiselect

A multiselect lets people choose several options from a list. Chosen options show as removable chips, and all of them submit with the form.

Stable Figma
OverviewUsageAPIAccessibility
<tk-field label="Colors">
  <tk-multiselect name="colors" placeholder="Choose colors">
    <option value="red" selected>Red</option>
    <option value="green">Green</option>
    <option value="blue" selected>Blue</option>
    <option value="yellow">Yellow</option>
  </tk-multiselect>
</tk-field>

Put the multiselect in a Field to give it a label, helper, and error. Without a Field, set aria-label; otherwise it has no name at all.

Anatomy

Part What it is
tk-multiselect the element; one Tab stop
field holds the chips, and the search text when searchable; grows as chips wrap
chip one chosen option, a removable Tag
clear-all button appears when something is chosen; removes every chip
chevron turns over while the menu is open
menu the options, as wide as the field; stays open while people choose
option one row with a leading checkbox

Variants

<tk-multiselect variant="filter" filter-label="Status">
  <option value="open" selected>Open</option>
  <option value="review" selected>In review</option>
  <option value="closed">Closed</option>
</tk-multiselect>
  • field (default): a form field with chips. Name it with a Field or aria-label.
  • filter: a compact button for a filter bar. It reads "Status" until something is chosen, then "Status (2)", and gets a tinted fill. The choices live in the menu; there are no chips. filter-label is required: it is the visible text and the accessible name. Don't put a filter in a Field.

Searchable

<tk-multiselect searchable aria-label="Skills" placeholder="Search skills">
  <option>Accessibility</option>
  <option>Illustration</option>
  <option>Motion design</option>
  <option>Prototyping</option>
</tk-multiselect>

searchable adds a text input that filters the menu as people type, the same way a Combobox does. Use it for long lists. A loadOptions loader turns it on. The filter variant can't be searchable.

Sizes

<tk-multiselect aria-label="Days" placeholder="Choose days">
  <option>Monday</option>
  <option>Tuesday</option>
</tk-multiselect>
<tk-multiselect size="large" aria-label="Months" placeholder="Choose months">
  <option>January</option>
  <option>February</option>
</tk-multiselect>
size Min height Padding-inline Text Option row
medium (default) 32px space-8 Body Small (14/20) 32px
large 36px space-10 Body Medium (16/24) 36px

With chips, the field's leading padding shrinks to space-4 so the chips line up with its edge. Chips wrap and the field grows; set max-rows to stop at about that many rows and scroll the rest.

States

<tk-multiselect aria-label="Regions" disabled>
  <option selected>Europe</option>
</tk-multiselect>
<tk-multiselect aria-label="Languages" readonly>
  <option selected>English</option>
  <option selected>Dutch</option>
</tk-multiselect>

Hover doesn't change the field. Keyboard focus colors its border and thickens it; there is no ring. While a chip has focus, the chip shows the ring instead. The filter variant tints on hover and shows a focus ring.

  • disabled: can't be focused or opened, and isn't submitted. Chips can't be removed.
  • readonly: shows the chips and submits them. The field stays focusable, but the menu doesn't open, chips can't be removed, and the clear-all button and chevron are hidden.
  • Error: set error on the Field. The message appears below and the border turns red, even while focused. The filter variant never turns red.

Selection limit

<tk-field label="Topics" helper="Choose up to 2">
  <tk-multiselect max="2" placeholder="Choose topics">
    <option>Design</option>
    <option>Research</option>
    <option>Writing</option>
  </tk-multiselect>
</tk-field>

max caps how many options people can choose. At the cap, the other options are disabled and the menu says "You can choose up to 2." Chosen options can still be removed.

Options and data

  • Write options as <option> children, with <optgroup> for groups. selected sets the starting choices.
  • data-description adds a short second line in the menu; chips show the label only.
  • Options can also come from the options property or a loadOptions loader, as in Combobox. A loader always shows the search input.
  • creatable adds a Create "…" row when a search matches nothing; choosing it adds a new chip. It follows the Combobox rules and stops at max.