Components / component

Focus Grid

v1.0.0 · premium

A grid where the hovered or focused photo comes forward while the others fade back.

Focus Grid demo

Implementation

A grid where the hovered or focused photo comes forward while the others fade back.

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 FocusGrid({ photos, label, columns = 3, ink, className }: {
  photos: readonly FocusPhoto[];
  /** Accessible name of the grid. */

Quality evidence

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

Changelog

v1.0.0 · A grid where the hovered or focused photo comes forward while the others fade back.

Frequently asked questions

How does it fade the other photos without script?

The has selector checks whether any photo is hovered or focused and dims the rest. It only applies hover on devices that can hover.

Are photos without links reachable by keyboard?

Yes. When a photo has no href it is made focusable so keyboard users reach it too.