← All Components
<mth-async-search>
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
Ready · interact with <mth-async-search>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/async-search"></script>
<mth-async-search debounce-ms="200"></mth-async-search>import '@methane-ui/ui/async-search';
import '@methane-ui/react';
export function Example() {
return <mth-async-search debounce-ms="200"></mth-async-search>;
}<script setup lang="ts">
import '@methane-ui/ui/async-search';
</script>
<template>
<mth-async-search debounce-ms="200"></mth-async-search>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/async-search';
import { MthAsyncSearchDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthAsyncSearchDirective],
template: `<mth-async-search debounce-ms="200"></mth-async-search>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/async-search';
import MthAsyncSearch from '@methane-ui/svelte/MthAsyncSearch.svelte';
</script>
<MthAsyncSearch debounce-ms="200"></MthAsyncSearch>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form field name. |
value | value | string | "" | Selected option value. |
defaultValue | default-value | string | "" | Initial value restored on form reset. |
dataSource | — | unknown | null | null | Abortable async DataSource returning matching options. |
debounceMs | debounce-ms | number | 200 | Input debounce duration in milliseconds. |
label | label | string | "" | Visible field label. |
placeholder | placeholder | string | "" | Search input placeholder. |
hint | hint | string | "" | Helper message. |
error | error | string | "" | Validation error message. |
open | open | boolean | false | Controls results popover visibility. |
disabled | disabled | boolean | false | Disables interaction. |
required | required | boolean | false | Requires a selected value. |
Events
| Event | Detail Type | Description |
|---|---|---|
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-open | undefined | Fired before opening results popover (cancelable). |
mth-after-open | undefined | Fired after opening results popover. |
mth-close | undefined | Fired before closing results popover (cancelable). |
mth-after-close | undefined | Fired after closing results popover. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowDown / ArrowUp | both | listbox open | navigates active search result |
| Enter | both | option active | selects active option and closes popover |
| Escape | both | listbox open | closes popover and restores focus |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 3 APG keyboard transitions across LTR/RTL. | mth-async-search.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required). | Conformance suite |
| i18n | Routes 7 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |