Actions

Sheet

A full-height side panel on a native dialog for details, filters or navigation.

Class nameTypeDescription
sheetplf:sheetComponentA Modal dialog as a panel on the end side
sheet-headerplf:sheet-headerPartTitle row with the close button
sheet-titleplf:sheet-titlePartThe panel's heading
sheet-descriptionplf:sheet-descriptionPartMuted text under the title
sheet-closeplf:sheet-closePartThe close button, with modal-close
sheet-iconplf:sheet-iconPartYour own SVG, in place of the drawn x; an icon class there doesn't need it
sheet-bodyplf:sheet-bodyPartThe scrolling content
sheet-footerplf:sheet-footerPartThe row of actions at the end
sheet-handleplf:sheet-handlePartThe bottom sheet's decorative handle
sheet-startplf:sheet-startPlacementOn the start side
sheet-bottomplf:sheet-bottomPlacementFrom the bottom edge; see Drawer

Project details

A little more context for the work ahead.

Owner: Jordan Rivera. Stage: In review.

The sheet’s first heading names it; give the close button an aria-label.

Sides

Sides are logical, so they swap in right-to-left layouts.

Start sheet

Jump to a section of this page.

End sheet

This sheet opens on the end side.

Owner: Jordan Rivera. Stage: In review.

With a form

Give the form method="dialog", which closes the sheet when it is submitted, and link the footer’s submit button to it with the form attribute.

Project filters

Choose the projects you want to see.

JavaScript

Sheet needs JavaScript. The Full script (pelatform-ui.min.js) starts every component on page load, with no code of your own; with ESM imports, call init() yourself, as in Installation. For markup you add later, see Dynamic content.

<link rel="stylesheet" href="pelatform-ui.min.css">
<script src="pelatform-ui.min.js" defer></script>
<link rel="stylesheet" href="pelatform-ui.prefixed.min.css">
<script src="pelatform-ui.min.js" defer></script>

Sheet adds no hooks, methods or events: use the Modal triggers, methods, events and keyboard.

The page stays inert while a sheet is open, so close it with PLF.Modal.getInstance(sheet).close() before following an in-page link.

React

Sheet from @pelatform/react renders this panel on a Modal: the application opens it with open and closes it in onOpenChange, and each part is a component of its own.

Prop Values Default
side start, or bottom for a Drawer The end side
open true while the sheet is open Required
onOpenChange (open, reason), called when the sheet asks to close: trigger (its close button), keyboard (Escape) or backdrop; keep open to stay open None
closeOnBackdrop true closes on a click outside the sheet false

The parts:

Part Element
SheetHeader A header with sheet-header
SheetTitle An h2 with sheet-title, or another heading with level, which names the sheet
SheetDescription A p with sheet-description, which describes the sheet
SheetClose A button with modal-close sheet-close: the drawn x and the name Close unless given others
SheetBody A div with sheet-body
SheetFooter A footer with sheet-footer
SheetHandle A div with sheet-handle, the bottom sheet’s handle

Other props are the element’s own, className and ref included.

CSS variables

Except for the width and gap, each variable falls back to its Modal variable.

Variable Default
--plf-sheet-width 24rem, capped to the viewport
--plf-sheet-bg, --plf-sheet-color Surface and text
--plf-sheet-border --plf-color-border-subtle, on the inner edge
--plf-sheet-shadow Large shadow
--plf-sheet-backdrop-bg --plf-color-backdrop
--plf-sheet-padding Space 6 (24px)
--plf-sheet-gap Space 4 (16px)
--plf-modal-radius 0 on a sheet

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons