Measured entry

motion-primitives-morphing-dialog

transition-effectspatialmotion on file

A composable React dialog whose trigger morphs into portaled modal content through shared-layout animation. It ships as copy-in TypeScript plus an outside-click hook, and depends on Motion, React DOM portals, Lucide icons, utility CSS classes, and a local class-name helper.

Specimen
Motion capture of the mounted demo, recorded by the harness. No audio track.
Harness screenshot of motion-primitives-morphing-dialog at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of motion-primitives-morphing-dialog at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of motion-primitives-morphing-dialog at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

Measured

Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.

Harness measurements recorded for motion-primitives-morphing-dialog
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal17.2 KB (82.6 KB build, 65.4 KB baseline)
Bare modeOK
Provider requiredNO
Demo usedwritten from the component source API

Verdict

A credible choice for detail reveals where spatial continuity matters. It builds and mounts cleanly in both prepared and bare harnesses, but its custom focus trap and dialog labeling deserve product-specific review before replacing a mature headless modal primitive.

Use it if

  • You want a card, image, or compact summary to expand into a related detail dialog.
  • Your product already uses Motion and can benefit from shared-layout transitions.
  • You need composable trigger, title, description, image, close, and content pieces rather than a fixed dialog template.

Skip it if

  • You need a minimal modal without an animation runtime or shared-layout behavior.
  • Your accessibility policy requires dialog primitives with independently audited labeling, focus management, and nested-overlay behavior.
  • Your styling stack cannot supply the utility classes and project-local helper expected by the copied source.

Install

Installation record for motion-primitives-morphing-dialog
Declared dependenciesmotion
Missing on installnone
Bare installbuilds and mounts without the shadcn-style helpers
Providerno provider required in the harness

In a non-shadcn project, copy both the dialog component and outside-click hook, install Motion and Lucide React, provide the class-name helper or replace it, configure the import aliases, and translate or enable the utility CSS classes used by the source.

Source and credit

This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.

Alternatives

Other published entries for the transition-effect pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.