Skip to content
Uxelith
Sign in
Prov1.0.0Cards

Morph Card

A card that grows into its own story: the photo, eyebrow and title fly to their places, and you pull the story down to fold it back into the grid. Built on the native modal dialog.

Installs with Uxelith ProHow
Licence
Pro
Packages
3
Updated
18 Oct 2026
Live

Installation

Usage

example.tsx
import { MorphCard } from "@/components/morph-card"

export function Story() {
  return (
    <MorphCard
      media={<div className="bg-gradient-to-br from-indigo-600 to-emerald-400" />}
      eyebrow="Field guide"
      title="Chasing the northern lights"
      summary="Where to stand and when to look up."
    >
      <p>The best displays come after midnight.</p>
    </MorphCard>
  )
}

Props

PropTypeDefaultDescription
mediaReactNode—Art or a photo; fills the card's top and grows into the story's header (16:9 in both).
titlestring—The card's button label and the story's heading.
eyebrowstring—A small line above the title.
summaryReactNode—Shown on the closed card only.
childrenReactNode—The story shown once it opens.
open / defaultOpenboolean— / falseControlled or initial state.
onOpenChange(open: boolean) => void—Called when it opens or closes.
headingLevel2 | 3 | 43Level of the card's title in your page outline.

Accessibility

  • The card's title is a button with aria-haspopup and aria-expanded; the whole card is its hit area.
  • The story is a native modal <dialog> labelled by its title: focus moves in and stays, the page behind is inert, and Escape closes.
  • Focus returns to the card, and the page doesn't scroll behind the story.
  • Pulling down to close is an extra: the close button, Escape and clicking outside always work.
  • Opens and closes in place under prefers-reduced-motion.

Changelog

  1. v1.0.0Latest

    First release.

More in Cards

All 6 in Cards
  • CardsPro

    Card Stack

    A deck you throw cards from: the top card leans from where you grabbed it and flies off with the speed you gave it, the rest rise to take its place, and Undo brings it back. Keys and buttons too.

  • CardsPro

    Compare Slider

    Two layers split by a glass handle you drag, or that follows the pointer. A press glides the divider there on a spring, a double-click sends it home; optional feathered seam, vertical split and first-view sweep.

  • CardsFree

    Pricing Card

    One plan in a pricing table, set large: a price that rolls when billing changes, a highlighted plan on a dark surface lit by your accent, and features read as included or not.