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.



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.
| Build | OK |
|---|---|
| Mount | OK |
| Console errors | 0 |
| Uncaught page errors | 0 |
| Horizontal overflow | clean at 375, 768, 1440 |
| Axe critical | 0 |
| Axe serious | 0 |
| Axe moderate | 0 |
| Axe minor | 0 |
| Gzip marginal | 17.2 KB (82.6 KB build, 65.4 KB baseline) |
| Bare mode | OK |
| Provider required | NO |
| Demo used | written 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
| Declared dependencies | motion |
|---|---|
| Missing on install | none |
| Bare install | builds and mounts without the shadcn-style helpers |
| Provider | no 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.
Author repository
github.com/ibelick/motion-primitivesAlternatives
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.
- motion-primitives-morphing-popoverspatial
- Renders
- YES
- A11y
- 0
- Gzip
- 17.3KB
- Bare
- pass
- Prov
- NO
- motion-primitives-animated-groupspatial
- Renders
- YES
- A11y
- 0
- Gzip
- 58.2KB
- Bare
- pass
- Prov
- NO
- ruixen-glass-shipment-flowliquid-glass
- Renders
- YES
- A11y
- 0
- Gzip
- 60.0KB
- Bare
- pass
- Prov
- NO
- magicui-animated-listunclassified
- Renders
- YES
- A11y
- 0
- Gzip
- 54.0KB
- Bare
- fail
- Prov
- NO
- magicui-blur-fadedark-futuristic
- Renders
- YES
- A11y
- 0
- Gzip
- 63.2KB
- Bare
- fail
- Prov
- NO
- motion-primitives-transition-panelspatial
- Renders
- YES
- A11y
- 0
- Gzip
- 67.8KB
- Bare
- fail
- Prov
- NO