{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "gallery-3",
  "title": "Masonry Column Gallery",
  "description": "Masonry image gallery section built on CSS columns with varied-ratio tiles, tag filters, hover caption overlays, and a lightbox dialog per photo.",
  "dependencies": [
    "@base-ui/react"
  ],
  "registryDependencies": [
    "badge",
    "button",
    "dialog",
    "toggle-group"
  ],
  "files": [
    {
      "path": "registry/blocks/gallery/3/gallery-block.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { Badge } from \"@/components/ui/badge\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogTitle,\n  DialogTrigger,\n} from \"@/components/ui/dialog\"\nimport { ToggleGroup, ToggleGroupItem } from \"@/components/ui/toggle-group\"\nimport { IconPlaceholder } from \"@/components/icons/icon-placeholder\"\n\ntype Tile = {\n  id: number\n  title: string\n  meta: string\n  tag: string\n  ratio: string\n  src: string\n  full: string\n}\n\nconst tiles: Tile[] = [\n  {\n    id: 1,\n    title: \"Mountain sunrise\",\n    meta: \"Rocky Mountains, CO\",\n    tag: \"Landscape\",\n    ratio: \"aspect-[4/5]\",\n    src: \"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1200&q=80\",\n  },\n  {\n    id: 2,\n    title: \"City skyline\",\n    meta: \"Chicago, IL\",\n    tag: \"Urban\",\n    ratio: \"aspect-square\",\n    src: \"https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?w=1200&q=80\",\n  },\n  {\n    id: 3,\n    title: \"Forest trail\",\n    meta: \"Olympic NP, WA\",\n    tag: \"Nature\",\n    ratio: \"aspect-[3/4]\",\n    src: \"https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1447752875215-b2761acb3c5d?w=1200&q=80\",\n  },\n  {\n    id: 4,\n    title: \"Ocean waves\",\n    meta: \"Big Sur, CA\",\n    tag: \"Coastal\",\n    ratio: \"aspect-[4/3]\",\n    src: \"https://images.unsplash.com/photo-1505144808419-1957a94ca61e?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1505144808419-1957a94ca61e?w=1200&q=80\",\n  },\n  {\n    id: 5,\n    title: \"Desert dunes\",\n    meta: \"Sahara, Morocco\",\n    tag: \"Landscape\",\n    ratio: \"aspect-[5/6]\",\n    src: \"https://images.unsplash.com/photo-1473580044384-7ba9967e16a0?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1473580044384-7ba9967e16a0?w=1200&q=80\",\n  },\n  {\n    id: 6,\n    title: \"Snowy peaks\",\n    meta: \"Lauterbrunnen, CH\",\n    tag: \"Alpine\",\n    ratio: \"aspect-square\",\n    src: \"https://images.unsplash.com/photo-1454496522488-7a8e488e8606?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1454496522488-7a8e488e8606?w=1200&q=80\",\n  },\n  {\n    id: 7,\n    title: \"Wildflower field\",\n    meta: \"Tuscany, Italy\",\n    tag: \"Nature\",\n    ratio: \"aspect-[4/5]\",\n    src: \"https://images.unsplash.com/photo-1490750967868-88aa4486c946?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1490750967868-88aa4486c946?w=1200&q=80\",\n  },\n  {\n    id: 8,\n    title: \"Coastal cliffs\",\n    meta: \"Moher, Ireland\",\n    tag: \"Coastal\",\n    ratio: \"aspect-[3/4]\",\n    src: \"https://images.unsplash.com/photo-1510414842594-a61c69b5ae57?w=800&q=80\",\n    full: \"https://images.unsplash.com/photo-1510414842594-a61c69b5ae57?w=1200&q=80\",\n  },\n]\n\nconst ALL_TAG = \"All\"\nconst tagList = [ALL_TAG, ...Array.from(new Set(tiles.map((t) => t.tag)))]\n\nexport default function GalleryBlock() {\n  const [active, setActive] = useState(ALL_TAG)\n\n  const visible =\n    active === ALL_TAG ? tiles : tiles.filter((t) => t.tag === active)\n\n  return (\n    <section className=\"flex w-full items-center justify-center bg-muted/30 px-6 py-16 text-foreground\">\n      <div className=\"mx-auto w-full max-w-5xl\">\n        <div className=\"mx-auto max-w-2xl text-center\">\n          <Badge variant=\"secondary\" className=\"gap-1.5 text-xs font-medium\">\n            <IconPlaceholder\n              lucide=\"Camera\"\n              tabler=\"IconCamera\"\n              hugeicons=\"CameraIcon\"\n              phosphor=\"Camera\"\n              remixicon=\"RiCameraLine\"\n              data-icon=\"inline-start\"\n              className=\"size-3.5\"\n              aria-hidden=\"true\"\n            />\n            Field Collection\n          </Badge>\n          <h2 className=\"mt-4 font-heading text-3xl font-bold tracking-tight sm:text-4xl\">\n            Acme in the wild\n          </h2>\n          <p className=\"mt-3 text-base text-muted-foreground\">\n            A curated set of places and moments captured by our community.\n            Filter by theme, then open any frame to see the full story.\n          </p>\n        </div>\n\n        <div className=\"mt-8 flex justify-center\">\n          <ToggleGroup\n            variant=\"outline\"\n            size=\"sm\"\n            value={[active]}\n            onValueChange={(value) => {\n              const next = value[0]\n              if (next) setActive(next)\n            }}\n            aria-label=\"Filter photos by theme\"\n            className=\"flex-wrap justify-center\"\n          >\n            {tagList.map((tag) => (\n              <ToggleGroupItem\n                key={tag}\n                value={tag}\n                aria-label={`Show ${tag} photos`}\n                className=\"text-xs font-medium tracking-wide\"\n              >\n                {tag}\n              </ToggleGroupItem>\n            ))}\n          </ToggleGroup>\n        </div>\n\n        <div className=\"mt-10 gap-4 [column-fill:_balance] sm:columns-2 lg:columns-3\">\n          {visible.map((tile) => (\n            <Dialog key={tile.id}>\n              <DialogTrigger\n                render={\n                  <button\n                    type=\"button\"\n                    aria-label={`View ${tile.title}`}\n                    className=\"group mb-4 block w-full break-inside-avoid overflow-hidden rounded-lg border border-border bg-card text-left focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none\"\n                  />\n                }\n              >\n                <figure>\n                  <div\n                    className={cn(\n                      \"relative w-full overflow-hidden rounded-lg bg-muted\",\n                      tile.ratio\n                    )}\n                  >\n                    <img\n                      src={tile.src}\n                      alt={tile.title}\n                      loading=\"lazy\"\n                      className=\"size-full object-cover transition-transform duration-500 ease-out group-hover:scale-105\"\n                    />\n                    <div className=\"absolute inset-x-0 bottom-0 bg-gradient-to-t from-foreground/85 via-foreground/30 to-transparent p-4\">\n                      <Badge\n                        variant=\"secondary\"\n                        className=\"mb-2 text-[10px] font-semibold tracking-wide\"\n                      >\n                        {tile.tag}\n                      </Badge>\n                      <figcaption className=\"text-sm font-semibold tracking-tight text-background\">\n                        {tile.title}\n                      </figcaption>\n                      <div className=\"mt-1 flex items-center gap-1.5\">\n                        <IconPlaceholder\n                          lucide=\"MapPin\"\n                          tabler=\"IconMapPin\"\n                          hugeicons=\"MapPinIcon\"\n                          phosphor=\"MapPin\"\n                          remixicon=\"RiMapPinLine\"\n                          className=\"size-3 shrink-0 text-background/70\"\n                          aria-hidden=\"true\"\n                        />\n                        <span className=\"truncate text-xs text-background/70\">\n                          {tile.meta}\n                        </span>\n                      </div>\n                    </div>\n                  </div>\n                </figure>\n              </DialogTrigger>\n\n              <DialogContent className=\"gap-0 p-0 sm:max-w-2xl\">\n                <DialogTitle className=\"sr-only\">{tile.title}</DialogTitle>\n                <DialogDescription className=\"sr-only\">\n                  {tile.title}, {tile.meta}.\n                </DialogDescription>\n                <div className=\"w-full overflow-hidden rounded-t-[inherit] border-b border-border bg-muted\">\n                  <img\n                    src={tile.full}\n                    alt={tile.title}\n                    className=\"max-h-[70vh] w-full object-contain\"\n                  />\n                </div>\n                <div className=\"flex items-start justify-between gap-3 p-5\">\n                  <div className=\"flex flex-col gap-1\">\n                    <span className=\"text-sm font-semibold tracking-tight text-foreground\">\n                      {tile.title}\n                    </span>\n                    <span className=\"flex items-center gap-1.5 text-xs text-muted-foreground\">\n                      <IconPlaceholder\n                        lucide=\"MapPin\"\n                        tabler=\"IconMapPin\"\n                        hugeicons=\"MapPinIcon\"\n                        phosphor=\"MapPin\"\n                        remixicon=\"RiMapPinLine\"\n                        className=\"size-3 shrink-0\"\n                        aria-hidden=\"true\"\n                      />\n                      {tile.meta}\n                    </span>\n                  </div>\n                  <Badge\n                    variant=\"secondary\"\n                    className=\"text-[10px] font-semibold tracking-wide uppercase\"\n                  >\n                    {tile.tag}\n                  </Badge>\n                </div>\n              </DialogContent>\n            </Dialog>\n          ))}\n        </div>\n\n        <div className=\"mt-6 flex flex-col items-center justify-between gap-4 border-t border-border pt-6 sm:flex-row\">\n          <p className=\"text-xs text-muted-foreground\">\n            Showing {visible.length} of {tiles.length} photos\n          </p>\n          <Button\n            render={<a href=\"#\" />}\n            nativeButton={false}\n            variant=\"outline\"\n            className=\"gap-1.5 text-xs font-medium\"\n          >\n            Explore Full Gallery\n            <IconPlaceholder\n              lucide=\"ArrowRight\"\n              tabler=\"IconArrowRight\"\n              hugeicons=\"ArrowRightIcon\"\n              phosphor=\"ArrowRight\"\n              remixicon=\"RiArrowRightLine\"\n              className=\"size-3.5\"\n              aria-hidden=\"true\"\n            />\n          </Button>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/blocks/gallery-3.tsx"
    }
  ],
  "meta": {
    "height": "1673px",
    "tier": "free"
  },
  "docs": "Requires a `base-*` style in components.json (the `shadcn init` default). Legacy `new-york`/`radix-*` styles install Radix primitives, which reject the `render` prop this block uses.",
  "categories": [
    "gallery"
  ],
  "type": "registry:block"
}