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

<mth-async-search>

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

Form-associated async search combobox backed by DataController with abortable queries, debounce, loading/empty/error states, and top-layer 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

Multi-Framework Playground & Snippets

<script type="module" src="@methane-ui/ui/async-search"></script>
<mth-async-search debounce-ms="200"></mth-async-search>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
namenamestring""Form field name.
valuevaluestring""Selected option value.
defaultValuedefault-valuestring""Initial value restored on form reset.
dataSource—unknown | nullnullAbortable async DataSource returning matching options.
debounceMsdebounce-msnumber200Input debounce duration in milliseconds.
labellabelstring""Visible field label.
placeholderplaceholderstring""Search input placeholder.
hinthintstring""Helper message.
errorerrorstring""Validation error message.
openopenbooleanfalseControls results popover visibility.
disableddisabledbooleanfalseDisables interaction.
requiredrequiredbooleanfalseRequires a selected value.

Events

EventDetail TypeDescription
mth-change{ value: string; item: unknown | null }Fired when user selects or clears a result.
mth-search{ query: string }Fired when an async query is dispatched.
mth-openundefinedFired before opening results popover (cancelable).
mth-after-openundefinedFired after opening results popover.
mth-closeundefinedFired before closing results popover (cancelable).
mth-after-closeundefinedFired after closing results popover.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowDown / ArrowUpbothlistbox opennavigates active search result
Enterbothoption activeselects active option and closes popover
Escapebothlistbox opencloses popover 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 3 APG keyboard transitions across LTR/RTL.mth-async-search.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