# expandable-card > Creates expandable/collapsible cards using CSS grid-rows animation with smooth transitions. Use when building accordions, expandable panels, collapsible sections, or show/hide card content. - Author: Ali Ihsan Nergiz - Repository: ainergiz/design-inspirations - Version: 20260107130342 - Stars: 4 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/ainergiz/design-inspirations - Web: https://mule.run/skillshub/@@ainergiz/design-inspirations~expandable-card:20260107130342 --- --- name: expandable-card description: Creates expandable/collapsible cards using CSS grid-rows animation with smooth transitions. Use when building accordions, expandable panels, collapsible sections, or show/hide card content. --- # Expandable Card Pattern Build smooth expand/collapse animations using CSS grid-rows, avoiding height:auto animation issues. ## Why grid-rows? Traditional height animation requires explicit pixel values. The `grid-rows` technique allows smooth animation to/from `auto` height: - `grid-rows-[0fr]` + `overflow-hidden` = collapsed (0 height) - `grid-rows-[1fr]` = expanded (natural height) ## Core Implementation ```tsx "use client"; import { useState } from "react"; import { ChevronDown } from "lucide-react"; function ExpandableCard() { const [expanded, setExpanded] = useState(true); return (
Expandable content goes here.