Expand Card

A card that grows smoothly out of its spot into a full dialog, then shrinks back.

no dependenciesMIT · free

Installation

npx shadcn@latest add https://ombakui.com/r/expand-card.json

Usage

import { ExpandCard } from "@/components/expand-card";

<ExpandCard label="Lumen Lamp" expanded={<ProjectDetails />}>
  <img src="/lumen.jpg" alt="" />
  <p className="p-4">Lumen Lamp</p>
</ExpandCard>

Props

PropTypeDefaultDescription
children*ReactNode–The compact card.
expanded*ReactNode–Content of the expanded view.
label*string–Accessible label for the expanded dialog.
classNamestring–Classes for the compact card.
panelClassNamestring"max-w-2xl"Classes for the expanded panel, e.g. a max width.