MorphDialog
Root of a dialog that morphs open from its trigger via a shared-element
layout animation - the trigger and the dialog card share a layoutId, so
Motion tweens position, size, radius, and shadow between them.
Controlled when open is passed, otherwise uncontrolled. Provides context
to the trigger, content, title, and description parts.
Usage
Best practices
Reach for
MorphDialogonly when the modal should animate out of its trigger element (shared-layout); a plain centred modal is aDialog.Pass the trigger's
borderRadius/boxShadowviastyle(notclassName) onMorphDialogTriggerso Motion can correct their distortion during the morph.Render a
MorphDialogTitle(usevisuallyHiddenif needed) for the accessible name; mountReducedMotionProviderat the app root since it animates viam.*.
Props
MorphDialog
MorphDialogContent
MorphDialogDescription
MorphDialogTitle
MorphDialogTrigger
Also exports
- const
useMorphDialog