Morphing Panel
ExperimentalExperimental — the contract and the rendering can change without notice. Own the installed copy before shipping it.A compact control that expands into settings, workspace navigation, or an inline confirmation, with stable alignment and keyboard dismissal.
Examples
Save, then confirm in place
A save control expands into a labelled, non-modal confirmation. autoFocus moves focus into the surface; Cancel, Confirm save, and Escape return it to the trigger. Header, Body, and Footer keep actions visible while long content scrolls. For a blocking modal, use Dialog instead.
Composition
Expandable surface
The surface stays in document flow. Content is scrollable; use Header, Body, and Footer to keep controls and actions visible. Escape closes the surface unless the event or onOpenChange is canceled.
- <MorphingPanel>
- <MorphingPanelTrigger />
- <MorphingPanelContent>
- <MorphingPanelHeader />
- <MorphingPanelBody>
- expanded content
- <MorphingPanelFooter>
- <MorphingPanelClose />
Anchored surface
Give Positioner a bounded width and height. anchor accepts center, top-start, top-end, bottom-start, and bottom-end. Logical edges respect RTL. Position this container with ordinary relative, absolute, or fixed layout; the panel is clamped to its bounds.
- <MorphingPanelPositioner>
- <MorphingPanel>
- <MorphingPanelTrigger />
- <MorphingPanelContent />
- <MorphingPanel>
Installation
The Control UI source installs this primitive from src/registry/sources/control-ui/ui/morphing-panel.tsx.
Dependencies
Raw code
Primary installed source
Knobs
Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.
--cui-morphing-panel-* · 7 knobsHow the cascade resolves--cui-morphing-panel-radius<length-percentage>var(--radius-control)--cui-morphing-panel-background<color>var(--card)--cui-morphing-panel-foreground<color>var(--card-foreground)--cui-morphing-panel-border-color<color>oklch(from var(--border) l c h / 0.8)--cui-morphing-panel-shadow*var(--shadow-md)--cui-morphing-panel-trigger-hover-background<color>oklch(from var(--foreground) l c h / 0.06)--cui-morphing-panel-border-width<length>var(--control-rim-width)