127+ Primitives

Expandable Cards

Cards

Interactive horizontal accordion showcase cards highlighting UI library features and architectural pillars with spring flex-grow expansions, gradient backdrops, and animated quotes.

NewInteractiveSpring PhysicsAccordion
/r/expandable-cards.json
Design Engineering

How Leading Teams Build

Explore all components

Kinetic Physics

Spring-mass-damping equations tuned for real-time 120Hz tactility.

Motion isn't a cosmetic afterthought — it's tactile communication.Every interaction preserves physical velocity and momentum.
AR

Alex Rivera, Design Technologist

Explore →

Installation

Install directly into your project using the shadcn CLI or copy the source code manually.

Requires:framer-motionclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/expandable-cards.json"

Props

TypeScript props supported by <ExpandableCards />.

9 props
PropTypeDefaultDescription
storiesExpandableCardItem[]—Array of card items containing id, name, tagline, quote, author, role, initials, href, ctaText, bg, border, and logo (ReactNode or Component).
itemsExpandableCardItem[]—Alternative alias prop for stories.
defaultActiveIdnumber | string1ID of the card that should be expanded by default on initial render.
titleReact.ReactNode—Custom headline element rendered at the top left of the section.
subtitleReact.ReactNode—Descriptive eyebrow subtitle text rendered above the main headline.
headerActionReact.ReactNode—Custom top-right element or link to override the default explore action.
moreStoriesTextstring—Label for the link in the header linking to the component catalog.
moreStoriesHrefstring—Destination URL for the header action.
classNamestring—Optional Tailwind CSS class overrides applied to the outer section container.

Key Features

  • Spring-driven flex-grow animation smoothly expanding the active card while compacting siblings.
  • Responsive layout: transitions gracefully from a horizontal accordion on desktop to a vertical stack on mobile.
  • Fully dynamic prop API: logos, brand gradients, quotes, titles, and actions are passed directly as props.
  • Accessible keyboard navigation with tab focus, Enter/Space expansion, and reduced motion fallbacks.

Keyboard & Accessibility

  • Each card implements role='button', tabIndex={0}, and dynamic aria-expanded state.
  • Keyboard activation supported via Enter and Space keys.
  • Respects prefers-reduced-motion to switch states instantly without spring oscillations.