Lightbox

A grid of thumbnails. Each one grows into a full-screen view you can step or swipe through.

A cobalt ceramic cup of coffee on a brushed steel counter in morning light.

1 / 6

import { Lightbox } from '@brand-studio/ui';
import { beans, cameraViews, cup, pour } from '@/demos/assets';

export default function LightboxDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 720, padding: '32px 0' }}>
      <Lightbox label="Field notes" images={[cup, beans, pour, cameraViews[0], cameraViews[2], cameraViews[5]]} />
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { Lightbox } from '@brand-studio/ui';
<Lightbox label="Field notes" images={images} />

Masonry

Set layout="masonry" to keep each image's own shape in columns.

A cobalt ceramic cup of coffee on a brushed steel counter in morning light.

1 / 8

import { Lightbox } from '@brand-studio/ui';
import { beans, cameraViews, cameraWides, cup, pour } from '@/demos/assets';

export default function LightboxMasonryDemo() {
  return (
    <div style={{ width: '100%', maxWidth: 720, padding: '32px 0' }}>
      <Lightbox layout="masonry" label="Contact sheet" images={[cup, cameraViews[0], cameraWides[1], beans, cameraViews[3], pour, cameraWides[0], cameraViews[5]]} />
    </div>
  );
}

Accessibility

  • Thumbnails are buttons named by their image's alt text.
  • The full view is a native modal dialog: focus stays inside, Escape closes it and focus returns to the thumbnail.
  • Arrow keys step through images and the counter is announced.
  • With reduced motion the view opens and closes without growing.

API Reference

PropTypeDefault
imagesImageAsset[]–
label?string'Gallery'
layout?"grid" | "masonry"'grid'
className?string''

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.