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

<mth-availability-picker>

@methane-ui/admin~9.0 KB brotli (kit + Lit)~2.6 KB marginal

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

Interactive StageLive Custom Element · <mth-availability-picker> (@methane-ui/admin)
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
namenamestring""Form field name submitted in FormData.
valuevaluestring"{}"Serialized JSON schedule mapping weekday keys to arrays of enabled time slots.
disableddisabledbooleanfalseDisables all matrix cells and actions.
readonlyreadonlybooleanfalsePrevents toggling or drag-painting slots.
requiredrequiredbooleanfalseRequires at least one selected slot across the week.
errorerrorstring""Custom validation error text.
days—ReadonlyArray<unknown>—Weekday rows rendered in the matrix.
slots—ReadonlyArray<string>—Time-slot columns rendered per day.

Events

EventDetail TypeDescription
mth-change{ value: string; schedule: unknown }Emitted when one or more availability slots are toggled.

APG Keyboard Matrix

KeyDirectionWhenExpected Behavior
ArrowRightbothavailability matrix has focusmoves to next slot (or previous in RTL)
ArrowLeftbothavailability matrix has focusmoves to previous slot (or next in RTL)
ArrowDownbothavailability matrix has focusmoves to same time slot on next day
ArrowUpbothavailability matrix has focusmoves to same time slot on previous day
Spacebotha slot cell has focustoggles availability for that day and time slot
Enterbotha slot cell has focustoggles availability for that day and time slot

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 6 APG keyboard transitions across LTR/RTL.mth-availability-picker.spec.test.ts
statesExposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(required), :state(invalid), :state(user-invalid).Conformance suite
i18nRoutes 10 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test