BadtzUIBeta
Docs
Expandable Card

Expandable Card

A versatile and engaging UI component that allows users to explore content in a more immersive way.

Installation

pnpm dlx shadcn@latest add https://badtz-ui.com/r/expandable-card.json

Usage

import { ExpandableCard } from "@/components/ui/expandable-card";
<ExpandableCard
  title="Whispering Forest"
  src="/images/components/expandable-card/haunted-house.webp"
  description="A Yokai Tale"
>
  {content}
</ExpandableCard>

Props

ExpandableCard props.

PropTypeDescriptionDefault
titlestringThe title displayed on the card.-
srcstringThe URL of the image displayed at the top of the card.-
descriptionstringA short description displayed below the title.-
childrenReact.ReactNodeAdditional content displayed inside the expanded card.-
classNamestringCustom CSS classes for styling the card.-
classNameExpandedstringCSS classes applied when the card is expanded.-
[key: string]anyAny additional props passed to the parent component.-

Credits

  • This component is inspired by Linear

  • DockImage Split