Multi Select
A dropdown for picking several options, shown as removable chips.
<arc-multi-select>Overview
Multi Select lets people pick several values from a fixed list. Each selection shows as a removable tag chip inside the control. The text input is also a filter: typing narrows the dropdown to options whose label contains what you typed.
Options are <arc-option> children, each with a value attribute and its text content as the label. The dropdown opens on focus. ArrowUp and ArrowDown move through the options, and Enter or a click toggles one. Backspace in an empty input removes the last tag.
arc-change fires whenever the selection changes, with the value array in detail.value. A click outside closes the dropdown.
Guidelines
Do
- Always set a `label` so screen readers can name the field
- Use a `placeholder` that says what to pick, such as "Choose languages..."
- Keep option labels short. They become tags inside the control
- Set `value` to the current selections when editing an existing record
Don't
- Don't use it when only one value is allowed. Use Select
- Don't load a long option list. Every matching option renders, so filter on the server instead. `arc-input` gives you the query on each keystroke
- Don't disable a field that has selections without saying why it can't be edited
Features
- Selected options show a check mark in the dropdown
- Escape closes the dropdown
- "No results found" shows when the filter matches no options
Preview
Usage
This component needs JavaScript. Use the Web Component or a framework wrapper.
<arc-multi-select label="Languages" placeholder="Choose...">
<arc-option value="js">JavaScript</arc-option>
<arc-option value="ts">TypeScript</arc-option>
<arc-option value="py">Python</arc-option>
</arc-multi-select>import { MultiSelect, Option } from '@arclux/arc-ui-react';
export default function Example() {
return (
<MultiSelect label="Languages" placeholder="Choose...">
<Option value="js">JavaScript</Option>
<Option value="ts">TypeScript</Option>
<Option value="py">Python</Option>
</MultiSelect>
);
}<script setup>
import { MultiSelect, Option } from '@arclux/arc-ui-vue';
</script>
<template>
<MultiSelect label="Languages" placeholder="Choose...">
<Option value="js">JavaScript</Option>
<Option value="ts">TypeScript</Option>
<Option value="py">Python</Option>
</MultiSelect>
</template><script>
import { MultiSelect, Option } from '@arclux/arc-ui-svelte';
</script>
<MultiSelect label="Languages" placeholder="Choose...">
<Option value="js">JavaScript</Option>
<Option value="ts">TypeScript</Option>
<Option value="py">Python</Option>
</MultiSelect>import { Component } from '@angular/core';
import { MultiSelect, Option } from '@arclux/arc-ui-angular';
@Component({
imports: [MultiSelect, Option],
template: `
<arc-multi-select label="Languages" placeholder="Choose...">
<arc-option value="js">JavaScript</arc-option>
<arc-option value="ts">TypeScript</arc-option>
<arc-option value="py">Python</arc-option>
</arc-multi-select>
`,
})
export class MyComponent {}import { MultiSelect, Option } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<MultiSelect label="Languages" placeholder="Choose...">
<Option value="js">JavaScript</Option>
<Option value="ts">TypeScript</Option>
<Option value="py">Python</Option>
</MultiSelect>
);
}import { MultiSelect, Option } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<MultiSelect label="Languages" placeholder="Choose...">
<Option value="js">JavaScript</Option>
<Option value="ts">TypeScript</Option>
<Option value="py">Python</Option>
</MultiSelect>
);
}API
placeholderstring''- Hint text shown inside the control when no items are selected and the input is empty.
labelstring''- Visible label rendered above the control in a small uppercase style.
namestring''disabledbooleanfalse- Disables the control, preventing interaction and reducing opacity to 50%.
valuestring[][]- Array of selected option values. Updated when items are toggled and emitted via
arc-change. readonlybooleanfalse- Prevents toggling options or removing chips while the control stays focusable; the dropdown can still be opened for viewing and the values still submit.
size'sm' | 'md' | 'lg''md'- Control size.
mdis the default;smandlgscale the control height and padding. formAssociatedbooleantruepropertiesobject{ // flag(), unlike `disabled`. The exclusion in props.js is specifically // about form-associated *platform* semantics: a `disabled` content // attribute that is merely present makes the element actually disabled // per the HTML spec, and formDisabledCallback assigns the property back, // so no converter can win. Neither of these is platform-mapped: // `required` is enforced by _computeValidity() below and `readonly` by // each component's own interaction handlers, so the stock converter buys // nothing here and costs the usual bug: `required="false"` read as true, // blocking submission of a form the author meant to leave optional. // Finding #48's shape, across all 26 form controls at once. required: flag(false), readonly: flag(false), }- Lit merges static properties up the prototype chain, so every consumer
gets these without declaring them.
requiredparticipates in constraint validation below;readonlyreflects for styling and is enforced by each component's interaction handlers (the mixin can't know which gestures mutate state). autoValidatesbooleantrue- Components that run their own constraint-validation logic (pattern checks, range checks) opt out of the automatic required sync by overriding this to false, and own the whole validity flag set instead.
formvalidityvalidationMessagerequiredbooleanfalse
Methods
checkValidity()boolean- Whether the control currently satisfies its constraints, per the native
constraint-validation API. Fires
invalidon the element when it does not, and reports nothing to the user. reportValidity()boolean- As checkValidity(), but also shows the browser's validation message against the control when it fails.
Events
arc-changedetail:{ value: string[] }- Fired when the selected values change
arc-inputdetail:{ value: string }- Fired on every keystroke in the filter input.
event.detail.valuecontains the current query text.
See also
- SelectA dropdown for choosing one option from a list in a form.
- ComboboxA text input that filters a list of options as you type, for picking one value from a long list.
- ChipA pill that toggles on and off. A row of them lets users pick any number of options.
- TagA small uppercase pill for a category or filter, with an optional button to remove it.