Sheet

Material Design 3 side sheet and bottom sheet web components (lit-material-side-sheet, lit-material-bottom-sheet).

  • 1.9 KB gzipped
  • @lit-material/sheet 0.1.0
  • Renders on the server

Example

Install

npm install @lit-material/sheet @lit-material/tokens
import "@lit-material/sheet";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-bottom-sheet>

Material Design 3 bottom sheet — a full-width panel of supplementary content anchored to the bottom edge, the same standard/modal split as lit-material-side-sheet/lit-material-navigation-drawer: standard renders as a plain, always-in-flow container (e.g. a persistent player bar docked at the bottom of your layout); modal (the default — a bottom sheet is far more commonly a temporary, dismissible surface than a persistent one) wraps the same content in a native <dialog>, so the scrim, Escape-to-close, and focus trap all come from the browser.

Properties

PropertyAttributeTypeDefaultDescription
variantvariantBottomSheetVariant"modal"
openopenbooleanfalseWhether a modal sheet is open. Ignored for standard.
disableBackdropClosedisable-backdrop-closebooleanfalseIf set, clicking the backdrop does not close a modal sheet.
showDragHandleshow-drag-handlebooleantrueShows the decorative drag-handle bar at the top of the sheet.

Events

EventDescription
closemodal only: re-dispatched from the native close event.
cancelmodal only: re-dispatched from the native cancel event. Cancelable: calling preventDefault() stops the sheet from closing.

Slots

SlotDescription
defaultThe sheet's content.
headerOptional header content (a title, a close button…), below the drag handle.

CSS parts

PartDescription
dialogThe native <dialog> element. Only rendered for modal.
sheetThe visible panel (background, shape, padding).
drag-handleThe decorative handle bar, only rendered while showDragHandle is set.
headerThe header slot's container.
contentThe default slot's container.

<lit-material-side-sheet>

Material Design 3 side sheet — a vertical panel of supplementary content (details, filters, a contextual editor…), structurally the same standard/modal split as lit-material-navigation-drawer minus the selection model: standard renders as a plain, always-in-flow container you place in your own layout; modal wraps the same content in a native <dialog> (the same foundation lit-material-dialog uses), so the scrim, Escape-to-close, and focus trap all come from the browser. position picks which edge a modal sheet slides in from — "end" (the right, in LTR) by default, since a side sheet is typically evoked alongside primary navigation anchored to "start", not on top of it.

Properties

PropertyAttributeTypeDefaultDescription
variantvariantSideSheetVariant"standard"
positionpositionSideSheetPosition"end"
openopenbooleanfalseWhether a modal sheet is open. Ignored for standard.
disableBackdropClosedisable-backdrop-closebooleanfalseIf set, clicking the backdrop does not close a modal sheet.

Events

EventDescription
closemodal only: re-dispatched from the native close event.
cancelmodal only: re-dispatched from the native cancel event. Cancelable: calling preventDefault() stops the sheet from closing.

Slots

SlotDescription
defaultThe sheet's content.
headerOptional header content (a title, a close button…).

CSS parts

PartDescription
dialogThe native <dialog> element. Only rendered for modal.
sheetThe visible panel (background, width, padding).
headerThe header slot's container.
contentThe default slot's container.

Source on GitHub npm