Chewypixel component
Image Lightbox
A thumbnail that flies out to a larger view in the middle of the screen, over a lightly blurred page.
Installation
npx shadcn@latest add @chewypixel/image-lightboxUsage
import Image from "next/image";
import { ImageLightbox } from "@/components/ui/image-lightbox";
export function ProductPhoto() {
return (
<ImageLightbox src="/products/gumdrops.jpg" alt="A jar of gumdrops" className="rounded-xl">
<Image src="/products/gumdrops.jpg" alt="" width={240} height={160} className="rounded-xl object-cover" />
</ImageLightbox>
);
}Props
srcThe full-size image.
string
altDescribes the image. It's also shown as the title above it.
string
roundOpens as a circle, for avatars.
boolean = false
unoptimizedSkips Next.js image optimization for the full-size image. Remote images need it, or their host in images.remotePatterns.
boolean = false
childrenThe thumbnail. Any element works.
ReactNode
Released under the MIT License.
More components
- SelectA select whose list pops open on a frosted panel, with a soft halo on the trigger while it's open.
- PopoverA frosted panel that scales in from its trigger and animates out before it closes.
- Date PickerA date field that opens a calendar. Months slide in the direction you page, and arrow keys move between days.
- Password InputA password field with a button that shows or hides what you typed. The eye icon swaps with a quick pop.
See them in a real app
These components come from Mochi, our admin dashboard template built with Next.js, shadcn/ui and Motion.