Expandable Cards

Interactive React cards that expand to reveal content with smooth Motion animations. Accessible, keyboard-navigable expandable UI for portfolios and product showcases.

Open in v0~1.5 kB

Last updated: March 7, 2026

Summer Opening

Summer Opening

Play video
Fashion

Fashion

Play video
Gallery Art

Gallery Art

Play video
Dreams

Dreams

Play video

Installation

npx smoothui-cli add expandable-cards

Features

  • Expand/collapse with animated layout
  • Keyboard navigable and accessible
  • Grid or list layouts supported
  • Easy theming

Accessibility

Keyboard Interactions

KeyDescription
EnterToggles expand/collapse on the focused card
SpaceToggles expand/collapse on the focused card
TabMoves focus between cards

ARIA Attributes

AttributeElementPurpose
role="button"Card containerIndicates the card is an interactive element
aria-labelCard containerDescribes the card title and its expanded/collapsed state
aria-selectedCard containerIndicates which card is currently expanded
tabIndex={0}Card containerMakes each card focusable

Screen Reader

  • Each card announces its title and whether it is expanded (e.g., "Nature card, expanded").
  • The play button inside each card has a descriptive aria-label (e.g., "Play video: Nature").

Reduced Motion

This component respects the prefers-reduced-motion media query via useReducedMotion from Motion. When reduced motion is preferred, expand/collapse width transitions and content blur animations are disabled.

Props