Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-multi-select>

@methane-ui/ui~12.3 KB brotli (cold + Lit)~4.4 KB marginal

Form-associated multi-select combobox with removable tag chips, search filtering, keyboard navigation, and top-layer popover listbox.

When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.

Live Interactive Preview

Interactive StageLive Custom Element · <mth-multi-select> (@methane-ui/ui)
Ready · interact with <mth-multi-select>, or toggle Theme, Direction (LTR/RTL), or props above.

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/multi-select"></script>
<mth-multi-select max-selections="0"></mth-multi-select>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
namenamestring""Form field name.
valuevaluestring""Comma-separated string of selected option values.
defaultValuedefault-valuestring""Default comma-separated value restored on form reset.
options—ReadonlyArray<unknown> | nullnullAvailable selectable options.
labellabelstring""Field label.
placeholderplaceholderstring""Placeholder shown when no options are selected.
hinthintstring""Helper message.
errorerrorstring""Validation error message.
openopenbooleanfalseControls dropdown visibility.
disableddisabledbooleanfalseDisables interaction.
requiredrequiredbooleanfalseRequires at least one selected value.
maxSelectionsmax-selectionsnumber0Maximum number of allowed selections (0 means unlimited).

Events

EventDetail TypeDescription
mth-change{ value: string; values: ReadonlyArray<string> }Fired when selected values change.
mth-openundefinedFired before opening the listbox overlay (cancelable).
mth-after-openundefinedFired after opening the listbox overlay.
mth-closeundefinedFired before closing the listbox overlay (cancelable).
mth-after-closeundefinedFired after closing the listbox overlay.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDown / ArrowUpbothcombobox opennavigates active option
Enterbothoption activetoggles active option selection
Backspacebothsearch input empty and tags existremoves last selected tag
Escapebothlistbox opencloses listbox and restores focus

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusdelegatesFocus: true with zero host internals.role (ADR-014).lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
keyboardImplements all 4 APG keyboard transitions across LTR/RTL.mth-multi-select.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required).Conformance suite
i18nRoutes 7 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test