ExpandCard

Card that grows in place to reveal more. Siblings reflow smoothly. Cards.

Open playground

About

ExpandCard is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ExpandCard } from "@ashutoshswamy/smoui" and set title, summary, children among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { ExpandCard } from "@ashutoshswamy/smoui";

<ExpandCard title="Release notes" summary="v0.2.0" className="w-72 rounded-2xl bg-neutral-100 p-5">
  <p>Twelve new components.</p>
</ExpandCard>

Props 4

title

Always-visible heading.

ReactNode
summary

Secondary line under the title.

ReactNode
children

Content revealed when open.

ReactNode
defaultOpen

Start expanded.

booleandefault false