Components · Motion
Shared Element
BetaAdded v4.4.0
Morphs the same element between two states or pages inside a view transition.
import { SharedElement } from '@nexub/react';Examples
List to detail
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| namerequired | string | — | Same name on both sides, e.g. avatar-${id}. One element per name on screen at a time. |
| childrenrequired | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | — | One element; the name is set on it. |
Accessibility
Screen reader
Visual only: run the change in `startViewTransition()` and move focus to the new view as usual.
On iOS & Android
Web only
Shared Element has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.