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.

Edit profile

Make changes to your profile here. Click save when you're done.

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.

bash
$ pnpm dlx shadcn@latest add https://essential-dialog.vercel.app/r/essential-dialog-gsap.json
Or install it by namespace

Worth registering once if you plan to pull several items — after that they resolve by name.

bash
$ pnpm dlx shadcn@latest registry add @essential=https://essential-dialog.vercel.app/r/{name}.json
$ pnpm dlx shadcn@latest add @essential/essential-dialog-gsap

Side 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)

Edit profile

Make changes to your profile here. Click save when you're done.

GSAP Flip — width/height

Themed with CSS variables

Identical knobs to the Motion build, because nothing about the theming is engine-specific.

New transaction

New transaction

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.

New transaction

New transaction

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.

backdropdrag wrappersurfacewindow

New transaction

New transaction

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 cyclesMotion (default)GSAP
bundle, gzipped45.4 kB, or nothing if the app already ships Motion39.5 kB
layout45 events · 5 ms1,024 events · 54 ms
style recalculation1,855 · 190 ms2,197 · 137 ms
paint2,865 · 180 ms1,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?
number

Seconds the trigger → dialog morph takes.

0.7
closeDuration?
number

Seconds 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.45
draggable?
boolean

Drag the surface anywhere to dismiss. Always off under prefers-reduced-motion.

true
hideTrigger?
boolean

Hide 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.

true
dismissOnOutsideClick?
boolean

Click 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.

true
dismissDistance?
number

Radial px the surface must travel before release dismisses it.

100
dismissSpeed?
number

px per ms, so a flick counts even when it barely moves.

0.5
dragFalloff?
number

scale = 1 - distance / dragFalloff, floored at 0.3.

415
fullscreen?
boolean | number | string

Open 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.

false
debug?
boolean

Outline every layer and log the boxes, live coverage and drag thresholds the morph is measured from.

false
open?
boolean

Controlled state. Drives showModal()/close() rather than rendering a different tree.

–
defaultOpen?
boolean

Open on mount. Uncontrolled only.

false
onOpenChange?
(open: boolean) => void

Fires once the morph has fully finished, in either direction.

–

EssentialDialogContent

className?
string

Styles the morphing surface — the box Flip animates.

–
windowClassName?
string

Styles the scrolling content box inside the surface.

–
backdropClassName?
string

Styles the backdrop element.

–
showCloseButton?
boolean

The unstyled ✕ in the corner.

true

Parts

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.

EssentialDialogHeader
div props

Layout only: flex column, gap 2.

EssentialDialogFooter
div props

Layout only: reversed column that becomes a right-aligned row at sm.

EssentialDialogTitle
h2 props

Wires aria-labelledby on the dialog.

EssentialDialogDescription
p props

Wires aria-describedby on the dialog.