Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Overlays

Drawer <pm-drawer>

Side sheet / drawer (a modal dialog anchored to an edge). side="bottom" is a bottom sheet with a grab handle that can be swiped down to close on touch screens.

Full screen
Open drawer
In stock On sale
Cancel Apply

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/button'; import '@prismora/elements/checkbox'; import '@prismora/elements/drawer'; import '@prismora/elements/range-slider'; </script> <pm-button commandfor="demo-drawer" command="--open" variant="soft">Open drawer</pm-button> <pm-drawer id="demo-drawer" heading="Filters" description="Narrow the product list." side="end"> <div class="pm-stack"> <pm-checkbox checked>In stock</pm-checkbox> <pm-checkbox>On sale</pm-checkbox> <pm-range-slider label="Price" min="0" max="500" step="10" value="50,300" unit=" €" show-value></pm-range-slider> </div> <pm-button slot="footer" variant="ghost" tone="neutral" commandfor="demo-drawer" command="--close">Cancel</pm-button> <pm-button slot="footer">Apply</pm-button> </pm-drawer>

Attributes

AttributeTypeDefaultDescription
side'start' | 'end' | 'top' | 'bottom'endEdge the drawer slides in from: start, end (default), top, or bottom (a bottom sheet).
mobileboolean—Native mobile patterns on phones; not set means as the ancestors say, false opts out.
openbooleanfalseOpen. Setting it opens or closes it (without pm-request-close).
headingstring—Title in the header; it names the dialog.
descriptionstring—Text under the title; it describes the dialog.
size'sm' | 'md' | 'lg' | 'full'—Width: sm, md (default), lg or full.
dismiss'any' | 'closerequest' | 'none'closerequestany = click outside or Esc · closerequest = Esc only · none = only explicit close.
mobile-variant
prop: mobileVariant
'sheet' | 'center' | 'fullscreen'—Phone layout when native mobile is on: bottom sheet (default), center, or fullscreen.
close-label
prop: closeLabel
stringCloseAccessible name of the close button (default "Close").

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-openonPmOpenOpened.
pm-closeonPmCloseClosed.
pm-request-closeonPmRequestCloseThe user asked to close it (cancelable: preventDefault() keeps it open). detail.reason says how.

Slots

SlotDescription
(default)Body.
footerActions.

CSS parts

PartDescription
::part(dialog)The native <dialog> box (size, padding, background).
::part(title)The heading.
::part(close)The close button.
::part(body)The body: the part that scrolls.
::part(footer)The footer.

Methods

show(), hide(), toggle(), close()

Used in templates

Overview dashboardTraffic analyticsOrdersCustomer 360InboxTeam chatAI assistantNotificationsProject boardTeam and rolesBilling and invoicesUser profileAccount settingsSign inCreate accountTwo-step verificationForgot passwordChoose a new passwordPricing plansProduct pageShopping cartCheckoutLanding pageArticleChangelogHelp centreContactComing soonNot found (404)Server error (500)Onboarding wizardAppointment bookingFeedback survey