Searching Open Sourcery

Type to search Open Sourcery.

Overlays & Panels

Sheet

Gesture-driven edge sheets and floating cards on a real native dialog — spring motion, snap points, responsive profiles.

v0.2.0@magic-spells/sheetRecommended

$ npm i @magic-spells/sheet

GitHubnpmSee it on the showcase →

Live demo

Snap points

Mode

Placement lab

These controls live inside the sheet because a modal dialog blocks the page behind it. Press one and the panel moves to its new position without closing.

Snap points

Mode

Change the position or the mode while the sheet is open — it flies to its new resting place without closing.

About

~22.9 kB gzipped (dist/sheet.min.js, with dialog-panel and all three engines bundled) plus ~2.0 kB for dist/sheet.min.css. The build measures both from the real artifacts into demo/dist/sizes.json, so the demo shows the exact figure.

Features

  • Bottom, top, left, and right edge sheets, plus a centered dialog profile
  • Inset card mode with independently configurable desktop presentation
  • Mobile-bottom-only CSS snap points, live dragging, nearest-snap release, and velocity flicks
  • Spring motion powered by @magic-spells/physics-engine and @magic-spells/frame-engine
  • Header, footer, handle strip, and scroll-aware content drag surfaces
  • Native dialog focus trapping, focus return, Escape handling, and modal semantics

Usage

<button id="open-sheet">Open sheet</button>

<dialog-panel id="account-panel">
	<dialog aria-labelledby="account-title">
		<sheet-panel
			snap-points="20vh 55vh 90vh"
			initial-snap="1"
			position="bottom"
			mode="edge"
			effect="slide"
			breakpoint="768"
			desktop-position="right"
			desktop-mode="card"
			desktop-exit-effect="fade-scale">
			<sheet-header>
				<h2 id="account-title">Account</h2>
				<button data-action-hide-dialog aria-label="Close">&times;</button>
			</sheet-header>

			<sheet-content>
				<p>Scrollable content goes here.</p>
			</sheet-content>

			<sheet-footer>
				<button>Save changes</button>
			</sheet-footer>
		</sheet-panel>
	</dialog>
</dialog-panel>

About, features, usage and options are taken from the package README.