Scrim
atomsFull-viewport click target that dims the page behind a custom panel: closes on click and on Escape (topmost only), optionally hidden under a viewport width.
Custom side panel
onclose fires on a click anywhere on the scrim and on Escape; the panel is yours. The stage contains the fixed scrim so the demo stays inside its frame.
Deploy history
12 deploys this week, 1 rolled back.Layer and tint
z picks the layer (drawer by default); style overrides the background for a darker or tinted wash; label names the click target.
then click or press Escape
Hidden on phones and stacked scrims
hideBelow skips the scrim under a viewport width for full-bleed mobile panels; with two open, Escape closes only the topmost.
The first scrim is skipped under 40rem viewports.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
onclose | () => void | — | Called on click anywhere on the scrim and on Escape (document-level). |
hideBelow | string | — | Viewport width (CSS length) under which the scrim is not rendered, for overlays that go full-bleed on small screens. |
z | string | number | 'var(--z-drawer)' | z-index; defaults to the drawer layer. |
label | string | 'Close' | Accessible name of the click target. |
class | string | '' | |
style | string | '' |