Componentdata1.28 KB gzipZero dependencies

Gallery Grid

Image gallery grid with fullscreen lightbox and keyboard paging.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add gallery-grid

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { GalleryGrid } from "@/components/ui/gallery-grid"; <GalleryGrid />

Source code

gallery-grid.tsx + 2 helpers

Zero third-party dependencies (3 local files shown in tabs below).

tsxgallery-grid.tsx111 lines
"use client"; import * as React from "react";import { getFocusable, lockBodyScroll, registerEscapeLayer, trapFocus } from "./lib/focus-trap";import { cn } from "./lib/utils"; export interface GalleryImage {  id: string;  src: string;  alt?: string;} export interface GalleryGridProps extends React.HTMLAttributes<HTMLDivElement> {  images: GalleryImage[];  columns?: 2 | 3 | 4;} /** Image gallery grid: expandable fullscreen lightbox view. */

Props

PropTypeDescription
imagesGalleryImage[]Configures images. (Default: [])
columns2 | 3 | 4Column definitions describing headers, cell keys, and sorting. (Default: 3)