← All Components
<mth-booking-widget>
Form-associated date & time slot booking widget (<mth-booking-widget>) combining CalendarCore date selection, time-slot picking, summary confirmation, 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-booking-widget>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/admin/booking-widget"></script>
<mth-booking-widget>Example</mth-booking-widget>import '@methane-ui/admin/booking-widget';
import '@methane-ui/react';
export function Example() {
return <mth-booking-widget>Example</mth-booking-widget>;
}<script setup lang="ts">
import '@methane-ui/admin/booking-widget';
</script>
<template>
<mth-booking-widget>Example</mth-booking-widget>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/admin/booking-widget';
import { MthBookingWidgetDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthBookingWidgetDirective],
template: `<mth-booking-widget>Example</mth-booking-widget>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/admin/booking-widget';
import MthBookingWidget from '@methane-ui/svelte/MthBookingWidget.svelte';
</script>
<MthBookingWidget>Example</MthBookingWidget>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
name | name | string | "" | Form field name submitted in FormData. |
value | value | string | "" | Selected booking slot (YYYY-MM-DDTHH:mm). |
disabled | disabled | boolean | false | Disables date, time-slot, and confirmation controls. |
readonly | readonly | boolean | false | Prevents slot selection changes. |
required | required | boolean | false | Marks booking slot selection as required. |
error | error | string | "" | Custom validation error text. |
availableSlots | — | ReadonlyArray<unknown> | — | Optional per-date override slot arrays. |
defaultSlots | — | ReadonlyArray<string> | — | Default time slots offered for dates without overrides. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { value: string; date: string; time: string } | Emitted when the selected date/time slot changes. |
mth-confirm | { value: string; date: string; time: string } | Emitted when the booking confirmation button is clicked. |
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 |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled), :state(readonly), :state(required), :state(invalid), :state(user-invalid). | Conformance suite |
| i18n | Routes 9 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |