← All Components
<mth-bottom-sheet>
Mobile-friendly modal bottom sheet backed by <dialog>, OverlayController, FocusTrapController, MotionController, and detent snapping.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Supports half, full, and collapsed detents with swipe & Escape dismissal.
Ready · interact with <mth-bottom-sheet>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/bottom-sheet"></script>
<mth-bottom-sheet detent="collapsed" closable>Example</mth-bottom-sheet>import '@methane-ui/ui/bottom-sheet';
import '@methane-ui/react';
export function Example() {
return <mth-bottom-sheet detent="collapsed" closable>Example</mth-bottom-sheet>;
}<script setup lang="ts">
import '@methane-ui/ui/bottom-sheet';
</script>
<template>
<mth-bottom-sheet detent="collapsed" closable>Example</mth-bottom-sheet>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/bottom-sheet';
import { MthBottomSheetDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthBottomSheetDirective],
template: `<mth-bottom-sheet detent="collapsed" closable>Example</mth-bottom-sheet>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/bottom-sheet';
import MthBottomSheet from '@methane-ui/svelte/MthBottomSheet.svelte';
</script>
<MthBottomSheet detent="collapsed" closable>Example</MthBottomSheet>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Controls whether the bottom sheet is open. |
detent | detent | 'collapsed' | 'half' | 'full' | "half" | Current vertical snap height (collapsed, half, or full). |
closable | closable | boolean | true | Renders a close button in the sheet header. |
lightDismiss | light-dismiss | boolean | true | Allows closing the sheet by clicking the backdrop. |
closeOnEscape | close-on-escape | boolean | true | Allows closing the sheet when pressing Escape. |
label | label | string | "" | Accessible title announced for the sheet dialog. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-open | undefined | Cancelable event fired before opening the sheet. |
mth-after-open | undefined | Fired after the sheet finishes opening. |
mth-close | { reason: string } | Cancelable event fired before closing the sheet. |
mth-after-close | undefined | Fired after the sheet closes. |
mth-detent-change | { detent: 'collapsed' | 'half' | 'full' } | Fired when the active detent changes. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Escape | both | open | Closes the bottom sheet and restores focus to trigger. |
| ArrowUp | both | handle focused | Expands the sheet detent. |
| ArrowDown | both | handle focused | Collapses or dismisses the sheet. |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | 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-bottom-sheet.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(open), :state(detent-collapsed), :state(detent-half), :state(detent-full), :state(dragging). | Conformance suite |
| i18n | Routes 3 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |