Skip to content
Components

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

A menu that grows from the corner

MorphingPanelPositioner keeps the bottom-start edge fixed as the surface expands. Give the positioner a bounded area; start and end follow the reading direction. Use ordinary navigation controls inside the panel.

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
        </MorphingPanelBody>
      • <MorphingPanelFooter>
        • <MorphingPanelClose />
        </MorphingPanelFooter>
      </MorphingPanelContent>
    </MorphingPanel>

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>
    </MorphingPanelPositioner>

Installation

The Control UI source installs this primitive from src/registry/sources/control-ui/ui/morphing-panel.tsx.

Registry command
See registry manifest

Dependencies

Raw code

Primary installed source

src/registry/sources/control-ui/ui/morphing-panel.tsx

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)