vael-ui v0.3.10

Overlays

BottomSheet

A panel that slides up from the bottom edge, common on touch layouts.

Install

import { BottomSheet } from 'vael-ui'

Playground

import { BottomSheet } from 'vael-ui'

<BottomSheet title="" initialSnap="" dismissible width="full" :fullScreen="false" closeOnEsc closeOnOverlay modal :closeOnHistoryBack="false">BottomSheet</BottomSheet>

Props

NameTypeDefaultDescription
titlestring | undefinedRenders the default header with built-in close button.
snapPointsSheetSnapPoint[] | undefinedOrdered smallest to largest. Default: 60% / 92% of viewport height. Ignored when `fullScreen` is set and this is left unspecified.
initialSnapstring | undefinedWhich snap point to open at. Defaults to the first (smallest).
dismissibleboolean | undefinedtrueWhether dragging past the smallest snap point closes the sheet. Default true.
width"md" | "sm" | "lg" | "full""full"Panel width: `full` spans edge to edge, `sm`/`md`/`lg` cap and center it. Default: `full`.
fullScreenboolean | undefinedfalseSingle snap point covering entire viewport height. Shorthand for `snapPoints=[{ id: 'full', height: 1 }]`.
closeOnEscboolean | undefinedtrueEscape key closes the sheet.
closeOnOverlayboolean | undefinedtrueClicking the overlay closes the sheet.
modalboolean | undefinedtrueDims the background and traps focus/scroll, like Dialog's own `modal`. Set `false` for an always-open, non-dismissible panel docked beside other interactive content (e.g. a persistent list next to a live map) — the overlay becomes fully transparent and inert instead of blocking the page behind it. Default true.
closeOnHistoryBackboolean | undefinedfalsePushes a history entry on open so the mobile hardware/gesture back action closes this sheet instead of navigating the page away. Default false.
beforeClose((done: () => void) => void) | undefinedCustom exit animation; call `done()` when complete. Fires for all close paths.
uiPartial<{ overlay: UiPartValue; panel: UiPartValue; handleZone: UiPartValue; handle: UiPartValue; header: UiPartValue; title: UiPartValue; close: UiPartValue; content: UiPartValue; }> | undefinedPer-instance part-class/style overrides.
openboolean | undefinedfalseWhether the sheet is open.

Slots

NameTypeDescription
default{ activeSnap: string | null; isDragging: boolean; isClosing: boolean; close: () => void; }
header{ close: () => void; }Replaces the default title + close-button row entirely.

Events

NameTypeDescription
update:open[value: boolean]

Exposed

NameTypeDescription
panelElHTMLElement | null
activeSnapstring | null
isDraggingboolean
isClosingboolean
close() => void
cancelClose() => void