Image Lightbox

A clickable image thumbnail that opens a full screen modal of the picture with a dimmed backdrop and a close button. Handy for screenshots and product shots.

src/registry/ui/image-lightbox.tsx/r/image-lightbox.json

Installation#

bash
npx shadcn@latest add @minidev/image-lightbox

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/image-lightbox.json

Usage#

tsx
import { ImageLightbox } from "@/components/ui/image-lightbox"

export function Example() {
  return <ImageLightbox />
}

API reference#

ImageLightbox props
PropTypeDefault
srcstringSAMPLE_IMAGE
altstring"Preview"
classNamestring-

Dependencies#

npm

lucide-react

Built from

All media and upload components