Multimodal
ImageGallery
Responsive image grid with built-in lightbox, keyboard navigation, and download.
Preview
Installation
pnpm add nyxis-ui
Usage
import { ImageGallery, type MediaAttachment } from 'nyxis-ui';
const images: MediaAttachment[] = [
{ id: '1', kind: 'image', url: '...', alt: 'first', width: 640, height: 426 },
// ...
];
<ImageGallery images={images} columns={3} />;
Anatomy
- Grid: 1 column on mobile,
2 | 3 | 4columns fromsm:upwards (default 3). - Each thumbnail is a square (
aspect-square) withobject-cover. Hover surfaces the filename. - Click opens the lightbox: full image, prev/next arrows, keyboard navigation (Esc / ←/→), close button, download link, dimensions readout.
- Set
disableLightboxto handle previews yourself;onSelectis then invoked with the index.
Use cases
- Image-generation batches (DALL-E, Stable Diffusion, Imagen).
- Vision-input galleries — what the user has uploaded so far.
- Reference-image picker for chat composers.