Expandable Cards

Interactive card layout where hovered cards expand smoothly for focused content viewing.

Installation

npx shadcn@latest add https://scrollxui.dev/registry/expandable-cards.json 

Usage

import ExpandableCards from "@/components/ui/expandable-cards";
<div className="h-[100px] sm:h-[300px] w-full select-none">
  <ExpandableCards
    cards={cards}
    defaultExpanded={3}
  />
</div>

API Reference

Expandable Cards

Interactive card layout where hovered cards expand smoothly for focused content viewing.

Props

PropertyTypeDefaultDescription
cardsExpandableCard[]required
Array of card objects, each containing an id and JSX content.
defaultExpandednumber1
ID of the card that should be expanded initially.
classNamestring
Optional additional class for custom styling of the container.

Built withby Ahdeetai.