← All Components
<mth-cascader>
Hierarchical multi-column cascader picker with form association, keyboard drill-down, and popover overlay.
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-cascader>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/cascader"></script>
<mth-cascader separator="/" clearable></mth-cascader>import '@methane-ui/ui/cascader';
import '@methane-ui/react';
export function Example() {
return <mth-cascader separator="/" clearable></mth-cascader>;
}<script setup lang="ts">
import '@methane-ui/ui/cascader';
</script>
<template>
<mth-cascader separator="/" clearable></mth-cascader>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/cascader';
import { MthCascaderDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthCascaderDirective],
template: `<mth-cascader separator="/" clearable></mth-cascader>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/cascader';
import MthCascader from '@methane-ui/svelte/MthCascader.svelte';
</script>
<MthCascader separator="/" clearable></MthCascader>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form field name submitted with FormData. |
value | value | string | "" | Selected path serialized with separator. |
defaultValue | default-value | string | "" | Initial path value used when resetting the form. |
separator | separator | string | "/" | Delimiter used between path segments in value and display. |
options | — | ReadonlyArray<unknown> | null | null | Hierarchical tree of CascaderOption items. |
label | label | string | "" | Accessible field label. |
placeholder | placeholder | string | "" | Placeholder shown when no path is selected. |
hint | hint | string | "" | Helper text displayed below the control. |
error | error | string | "" | Explicit error text displayed below the control. |
open | open | boolean | false | Controls whether the cascading popup is open. |
disabled | disabled | boolean | false | Disables user interaction and form submission. |
required | required | boolean | false | Marks selection as required for form validation. |
clearable | clearable | boolean | true | Shows a clear button when a value is selected. |
changeOnSelect | change-on-select | boolean | false | Commits intermediate parent nodes immediately on click. |
expandTrigger | expand-trigger | 'click' | 'hover' | "click" | Interaction that opens child columns (click or hover). |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string; path: ReadonlyArray<string>; selectedOptions: ReadonlyArray<unknown> } | Fired when the selected path changes or is cleared. |
mth-open | undefined | Cancelable event fired before opening the popup. |
mth-after-open | undefined | Fired after the popup opens. |
mth-close | undefined | Cancelable event fired before closing the popup. |
mth-after-close | undefined | Fired after the popup closes. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter / Space / ArrowDown | both | trigger focused and closed | opens cascader popup |
| ArrowDown / ArrowUp | both | popup open | moves focus within active column |
| ArrowRight / ArrowLeft | both | popup open | drills into child column or returns to parent column (RTL-aware) |
| Enter | both | option focused | expands children or commits leaf selection |
| Escape | both | popup open | closes popup and restores focus to trigger |
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 5 APG keyboard transitions across LTR/RTL. | mth-cascader.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(dirty), :state(touched), :state(user-invalid), :state(disabled), :state(required). | Conformance suite |
| i18n | Routes 5 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |