BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/tool-ui/image-gallery

Image Gallery

tool-ui/image-gallery
FreeBlock

Grid layout for browsing image collections.

See it running

Open the demo on tool-ui

www.tool-ui.com/components/image-gallery
Open
This registry sends X-Frame-Options, so its page cannot be embedded here. The link is the same page the frame would have shown.

Install it

npx shadcn@latest add https://www.tool-ui.com/r/image-gallery.json

Source

components/tool-ui/image-gallery/image-gallery.tsxwww.tool-ui.com/r/image-gallery.json
1"use client";
2
3import "./styles.css";
4import { cn } from "./_adapter";
5import { ImageGalleryProvider } from "./context";
6import { GalleryGrid } from "./gallery-grid";
7import { GalleryLightbox } from "./gallery-lightbox";
8import type { ImageGalleryProps } from "./schema";
9
10export function ImageGallery({
11 id,
12 images,
13 title,
14 description,
15 className,
16 onImageClick,
17}: ImageGalleryProps) {
18 const handleImageClick = (imageId: string) => {
19 if (!onImageClick) return;
20
21 const image = images.find((img) => img.id === imageId);
22 if (image) {
23 onImageClick(imageId, image);
24 }
25 };
26
27 return (
28 <article
29 className={cn("relative w-full min-w-80 max-w-lg", className)}
30 data-tool-ui-id={id}
31 data-slot="image-gallery"
32 >
33 <div
34 className={cn(
35 "@container relative isolate flex w-full min-w-0 flex-col rounded-xl",
36 "border border-border bg-card text-sm shadow-xs",
37 )}
38 >
39 <ImageGalleryProvider images={images}>
40 <Header title={title} description={description} />
41 <div className="p-3">
42 <GalleryGrid onImageClick={handleImageClick} />
43 </div>
44 <GalleryLightbox />
45 </ImageGalleryProvider>
46 </div>
47 </article>
48 );
49}
50
51interface HeaderProps {
52 title?: string;
53 description?: string;
54}
55
56function Header({ title, description }: HeaderProps) {
57 if (!title && !description) {
58 return null;
59 }
60
61 return (
62 <div className="border-border/60 border-b px-4 pt-4 pb-3">
63 {title && (
64 <h3 className="text-[15px] leading-tight font-semibold tracking-tight">
65 {title}
66 </h3>
67 )}
68 {description && (
69 <p className="text-muted-foreground mt-1 text-sm leading-snug">
70 {description}
71 </p>
72 )}
73 </div>
74 );
75}

What it pulls in

npm packages

  • lucide-react
  • zod

Other registry items

  • button

Files it writes

  • components/tool-ui/image-gallery/_adapter.tsx
  • components/tool-ui/image-gallery/context.tsx
  • components/tool-ui/image-gallery/gallery-grid.tsx
  • components/tool-ui/image-gallery/gallery-lightbox.tsx
  • components/tool-ui/image-gallery/image-gallery.tsx
  • components/tool-ui/image-gallery/index.tsx
  • components/tool-ui/image-gallery/README.md
  • components/tool-ui/image-gallery/schema.ts
  • components/tool-ui/image-gallery/styles.css
  • components/tool-ui/shared/contract.ts
  • components/tool-ui/shared/media/aspect-ratio.ts
  • components/tool-ui/shared/media/format-utils.ts
  • components/tool-ui/shared/media/index.ts
  • components/tool-ui/shared/media/overlay-gradient.ts
  • components/tool-ui/shared/media/safe-navigation.ts
  • components/tool-ui/shared/media/sanitize-href.ts
  • components/tool-ui/shared/parse.ts
  • components/tool-ui/shared/schema.ts

Facts

Registry
tool-ui
Type
registry:block
Access
Free
Files written
18
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on tool-ui www.tool-ui.com Raw registry item This item as JSON

More from tool-ui

All 27 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Approval Cardapproval-cardtool-uiBlocksFree2 deps · 11 files
Audioaudiotool-uiBlocksFree2 deps · 9 files
Chartcharttool-uiBlocksFree2 deps · 8 files
Citationcitationtool-uiBlocksFree2 deps · 15 files
Code Blockcode-blocktool-uiBlocksFree3 deps · 11 files
Code Diffcode-difftool-uiBlocksFree3 deps · 10 files
Data Tabledata-tabletool-uiBlocksFree1 dep · 17 files
Geo Mapgeo-maptool-uiBlocksFree4 deps · 12 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex