> ## Documentation Index
> Fetch the complete documentation index at: https://api.fanvue.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MorphPanel

> Animates a panel between views, such as the steps of a dialog or the sub-views of a sheet.

```tsx theme={null}
import { MorphPanel } from "@fanvue/ui";
import type { MorphPanelProps } from "@fanvue/ui";
```

## Examples

No runnable examples are generated for this component yet. See the
[Storybook](https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com) entry for live variants.

## Props

## MorphPanel

Animates a panel between views, such as the steps of a dialog or the sub-views of a sheet.

When `step` changes, the panel morphs from its old height to the new view's height over 300ms. The old view fades out quickly and the new one fades in with an 8px nudge, from the right when going deeper (a higher step) or from the left when going back. A part marked `data-morph-static`, such as a dialog header, holds still and only its heading crossfades. If the new view changes size within a second of the step change, for example when its data loads, the panel eases to the new height instead of snapping. With reduced motion the views swap instantly. The first view appears without a transition, so the panel's own entrance animation plays alone. Children keep their state across steps, and focus moves to the new view's heading.

`DialogContent` and `DrawerContent` wrap their children in one when given a `step`.

**step** `number` *required*

Which view is showing, in navigation order: a higher step is deeper. Changing it plays the transition; the view's own content changing does not.

Changing it does not remount the children: React reconciles them as usual, so content that stays across steps (such as a form wrapping every step and its uncontrolled inputs) keeps its state, and only the parts that differ between steps mount afresh. Give a view its own `key` to reset its state on entry.

After a change, focus moves to the first heading in the panel, so screen readers announce the new view, unless focus has already gone somewhere outside the panel.

## Exported types

Also exported from `@fanvue/ui`: `MorphPanelProps`.

***

**Setup:** [Installation](https://api.fanvue.com/docs/ui/installation.md) · [Theming](https://api.fanvue.com/docs/ui/theming.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.