Components / effect

Expanding Cards

v1.0.0 · premium

A row of image cards where the hovered or focused card opens wide and the rest narrow, turning into a column on small screens.

Expanding Cards demo

Implementation

A row of image cards where the hovered or focused card opens wide and the rest narrow, turning into a column on small screens.

Framework
React 19.3.1 with TypeScript
Motion
Native CSS and browser APIs. No GSAP required.
Available modes
build
Version
1.0.0 · published

Source code

Download source ZIP
export function ExpandCards({ items, expand = 4, ink, className }: {
  items: readonly ExpandCard[];
  /** How many times wider the open card is than a closed one. */

Quality evidence

Export tested in 2 consumer projects with chromium, firefox, webkit. Evidence recorded on .

Changelog

v1.0.0 · A row of image cards where the hovered or focused card opens wide and the rest narrow, turning into a column on small screens.

Frequently asked questions

What happens on narrow screens?

Below 520 px of container width the row becomes a column and the open card grows taller instead of wider.

How do keyboard users open a card?

Each card is a button with aria-expanded. Tabbing to a card opens it, and a click or tap opens it on touch.