← All Components
<mth-availability-picker>
Form-associated weekly recurring availability matrix (<mth-availability-picker>) supporting pointer click/drag painting, RTL-aware 2D keyboard navigation, and FormControlController validation.
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-availability-picker>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/admin/availability-picker"></script>
<mth-availability-picker value="{}">Example</mth-availability-picker>import '@methane-ui/admin/availability-picker';
import '@methane-ui/react';
export function Example() {
return <mth-availability-picker value="{}">Example</mth-availability-picker>;
}<script setup lang="ts">
import '@methane-ui/admin/availability-picker';
</script>
<template>
<mth-availability-picker value="{}">Example</mth-availability-picker>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/admin/availability-picker';
import { MthAvailabilityPickerDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthAvailabilityPickerDirective],
template: `<mth-availability-picker value="{}">Example</mth-availability-picker>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/admin/availability-picker';
import MthAvailabilityPicker from '@methane-ui/svelte/MthAvailabilityPicker.svelte';
</script>
<MthAvailabilityPicker value="{}">Example</MthAvailabilityPicker>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form field name submitted in FormData. |
value | value | string | "{}" | Serialized JSON schedule mapping weekday keys to arrays of enabled time slots. |
disabled | disabled | boolean | false | Disables all matrix cells and actions. |
readonly | readonly | boolean | false | Prevents toggling or drag-painting slots. |
required | required | boolean | false | Requires at least one selected slot across the week. |
error | error | string | "" | Custom validation error text. |
days | — | ReadonlyArray<unknown> | — | Weekday rows rendered in the matrix. |
slots | — | ReadonlyArray<string> | — | Time-slot columns rendered per day. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string; schedule: unknown } | Emitted when one or more availability slots are toggled. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| ArrowRight | both | availability matrix has focus | moves to next slot (or previous in RTL) |
| ArrowLeft | both | availability matrix has focus | moves to previous slot (or next in RTL) |
| ArrowDown | both | availability matrix has focus | moves to same time slot on next day |
| ArrowUp | both | availability matrix has focus | moves to same time slot on previous day |
| Space | both | a slot cell has focus | toggles availability for that day and time slot |
| Enter | both | a slot cell has focus | toggles availability for that day and time slot |
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 6 APG keyboard transitions across LTR/RTL. | mth-availability-picker.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(required), :state(invalid), :state(user-invalid). | Conformance suite |
| i18n | Routes 10 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |