Alternate engine
Essential Dialog, on GSAP
The same component driven by GSAP Flip, which animates a real width and height rather than projecting a transform. It exports exactly the same names as the default build, so switching engines is one import line. Reach for it if you would rather not add Motion, or if you want the surface relaid out every frame instead of scaled.
GSAP Flip — the surface's width and height are real at every frame.
Install
Same registry, different item. GSAP is the only runtime dependency; Flip and CustomEase have been free since 3.13.
$ pnpm dlx shadcn@latest add https://essential-dialog.vercel.app/r/essential-dialog-gsap.jsonOr install it by namespace
Worth registering once if you plan to pull several items — after that they resolve by name.
$ pnpm dlx shadcn@latest registry add @essential=https://essential-dialog.vercel.app/r/{name}.json
$ pnpm dlx shadcn@latest add @essential/essential-dialog-gsapSide by side
The same demo on both engines. Open each and watch the first 200ms — then the last 200ms of the close, which is where they differ most.
Motion — layoutId projection (default)
GSAP Flip — width/height
Themed with CSS variables
Identical knobs to the Motion build, because nothing about the theming is engine-specific.
Both buttons open the same dialog — each morph grows out of the shape you pressed.
Fullscreen
Same opt-in, same three forms: true for always, a number for a breakpoint, or any media query string.
<EssentialDialog fullscreen={768}>viewport: —px — resize the window to cross the breakpoint while the dialog is open.
Debug
Every layer outlined and every measurement logged. Move the sliders to feel why closing is shorter than opening — at equal durations there is a long middle where the box is neither the dialog nor the button.
What the engine costs
Measured, not estimated. Bundles are esbuild builds of exactly the imports each hook uses (minified, gzipped, React external). The rest is Chrome renderer tracing over six open-and-close cycles of the same dialog — not frame deltas, which in a headless browser are synthetic and will happily report a steady 8.3ms while nothing is rendered at all.
| per 6 open + close cycles | Motion (default) | GSAP |
|---|---|---|
| bundle, gzipped | 45.4 kB, or nothing if the app already ships Motion | 39.5 kB |
| layout | 45 events · 5 ms | 1,024 events · 54 ms |
| style recalculation | 1,855 · 190 ms | 2,197 · 137 ms |
| paint | 2,865 · 180 ms | 1,931 · 157 ms |
| renderer total | ~375 ms | ~348 ms |
Motion never touches width or height, so it does twenty times less layout — 5 ms against 54 ms. It pays that back in paint, because more elements animate at once: the surface, the miniature inside it, the backdrop and the placeholder crossfading underneath. Net renderer time lands within about 8% either way, which is why the choice is really about the dependency you already have rather than the frame budget.
Where they differ
Both morphs are measured rather than timed, so both survive being interrupted. GSAP Flip hands you the box and gets out of the way — `scale: false` gives real width and height, so the distortion class of bug does not exist and the trigger wrapper can be display:contents, costing the page nothing. Motion's projection wants to own the box, so the build around it takes the radius, both content scale axes and the settle detection back by hand, and needs an invisible placeholder in the page for the shared transition to pair against — which forces the trigger wrapper to inline-grid. What Motion gives back is a transform-based morph that never relayouts, springs as the authoring model, and no second animation library if you already have it.
API Reference
The same surface as the default build, minus `bounce` — the opening spring's overshoot, which only exists where the open is a spring. Everything else, dismissOnOutsideClick included, behaves identically.
EssentialDialog
openDuration?numberSeconds the trigger → dialog morph takes.
0.7closeDuration?numberSeconds the dialog → trigger morph takes. Shorter on purpose: at equal durations there is a long middle where the box is neither the dialog nor the button.
0.45draggable?booleanDrag the surface anywhere to dismiss. Always off under prefers-reduced-motion.
truehideTrigger?booleanHide the trigger while the dialog is open, so the button becomes the dialog instead of sitting beside it. Hidden with visibility, so the page never reflows around the gap and the close can still measure the box it lands in.
truedismissOnOutsideClick?booleanClick anywhere outside the surface to dismiss. Judged on where the pointer went down AND came up, so selecting a line of text and overshooting the edge does not close the dialog. Escape is unaffected either way.
truedismissDistance?numberRadial px the surface must travel before release dismisses it.
100dismissSpeed?numberpx per ms, so a flick counts even when it barely moves.
0.5dragFalloff?numberscale = 1 - distance / dragFalloff, floored at 0.3.
415fullscreen?boolean | number | stringOpen edge to edge instead of centred. true is always; a number is a breakpoint (fullscreen below that many px); a string is any media query. Crossing the breakpoint while open re-lays the dialog out.
falsedebug?booleanOutline every layer and log the boxes, live coverage and drag thresholds the morph is measured from.
falseopen?booleanControlled state. Drives showModal()/close() rather than rendering a different tree.
–defaultOpen?booleanOpen on mount. Uncontrolled only.
falseonOpenChange?(open: boolean) => voidFires once the morph has fully finished, in either direction.
–EssentialDialogContent
className?stringStyles the morphing surface — the box Flip animates.
–windowClassName?stringStyles the scrolling content box inside the surface.
–backdropClassName?stringStyles the backdrop element.
–showCloseButton?booleanThe unstyled ✕ in the corner.
trueParts
EssentialDialogTrigger{ render?: ReactElement }The origin of the morph. Flip reads this element's live geometry, colour and radius, so pass your own button through render.
EssentialDialogClose{ render?: ReactElement }Closes with the morph. Same render composition as the trigger.
EssentialDialogHeaderdiv propsLayout only: flex column, gap 2.
EssentialDialogFooterdiv propsLayout only: reversed column that becomes a right-aligned row at sm.
EssentialDialogTitleh2 propsWires aria-labelledby on the dialog.
EssentialDialogDescriptionp propsWires aria-describedby on the dialog.