Account

Cards

Creative

Morphing Card

It grows from where it sits into a centred panel, its face staying at the top while details unfold, and shrinks back on close.

Install

Included with Creative: needs your API key. Initialize and log in once.

Terminal
npx @galactrex/ui add morphing-card

Usage

Example
import { MorphingCard } from "@/components/galactrex/morphing-card";

<MorphingCard label="Orbit" details={<p>…</p>}><h3>Orbit</h3></MorphingCard>

Source

Installs to components/galactrex/morphing-card.tsx, with the shared motion primitives beside it.

Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.

See plans

Props

PropTypeDefaultDescription
childrenReactNode—Card face.
detailsReactNode—Added in the open view.
labelstring—Dialog name.
widthnumber560Open width in px.
classNamestring—Extra classes for the outer element.

Variants

  • Grid. A grid of these, one open at a time.

Accessibility

  • A modal dialog: focus moves in, is held, and returns to the card; Escape and backdrop close it.

Motion and reduced motion

  • Shared layout animation; one element owns the layout at a time.
  • Reduced motion: no travel.