Skip to content
Focsd homeFocsd homeFocsd
Forms

Bottom sheet

A panel from the bottom edge that rests at snap heights; swipe it, or use the handle and Close button.

  • Tag: focsd-bottom-sheet
  • Pattern: Modal dialog or region at the bottom edge, snap points, keyboard resize
  • Category: Overlays

Example

Filters
In stock On sale Apply
HTML
<focsd-button commandfor="sheet-demo" command="show-modal">Filters</focsd-button>
<focsd-bottom-sheet id="sheet-demo" label="Filters" snap-points="40%,90%">
<div class="stack">
<focsd-checkbox>In stock</focsd-checkbox>
<focsd-checkbox>On sale</focsd-checkbox>
<focsd-button data-dialog-close value="apply" variant="action">Apply</focsd-button>
</div>
</focsd-bottom-sheet>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/components/focsd-bottom-sheet.js';
</script>
<focsd-bottom-sheet label="Filters" snap-points="40%,90%">…</focsd-bottom-sheet>

API

Attributes

AttributePropertyTypeDefault
labellabelstring—
openopenbooleanfalse
snap-pointssnapPoints'auto' | (string & {})auto
snapsnapnumber0
non-modalnonModalbooleanfalse
persistentpersistentbooleanfalse

Methods

MethodDescription
show(opener)Open the sheet; focus returns to opener (default: the focused element) on close.
showModal(opener)Same as show() (the sheet is modal by default), so <focsd-button commandfor="…" command="show-modal"> opens it.
close(returnValue)Close the sheet.

Events

EventDescription
closeFired when the sheet closes.

Slots

SlotDescription
(default)The sheet content.

CSS parts

Style the inside of the component with ::part(), for example focsd-bottom-sheet::part(dialog).

PartDescription
dialogThe dialog (modal) or region (non-modal).
panelThe sheet itself.
headerThe header with the handle, title and close button.
handleThe resize handle.
gripThe handle's visible bar.
headlineThe title.
closeThe close button.
bodyThe scrolling content area.

Accessibility

  • Modal by default: a native dialog named by label, with a focus trap, an inert page, Escape, and focus back on the opener.
  • With non-modal it is a named region and the page stays usable.
  • The handle is a slider ("Resize sheet", "40% of the screen"); arrow keys, Home, End, Enter and Space change the height, and a Close button closes it, so dragging is never required (WCAG 2.5.7).
  • A drag that starts in scrolled content scrolls it; only a pull from the top moves the sheet. A downward flick dismisses.
  • Respects the iPhone home indicator area (env(safe-area-inset-bottom)) and reduced motion.

Keyboard

KeyAction
Up / Down (handle)Next or previous height
Left / Right (handle)Same as Down / Up
Home / End (handle)Lowest / highest height
Enter / Space (handle)Cycle heights
EscapeClose (modal)