# Lightbox Grid

A photo grid whose thumbnails grow into a full view and fly back to their slot when you drag them down.

Install with

```bash
npx shadcn@latest add https://kokonutui.com/r/lightbox-grid.json
```

## Installation

Lightbox Grid is a free, open-source React component in the Kokonut UI [Cards collection](/content/docs/cards/index.html). Add it with the shadcn CLI, which copies the source into `components/kokonutui/lightbox-grid.tsx`, so the code is yours to change.

```bash
npx shadcn@latest add @kokonutui/lightbox-grid
```

Or add it by hand: install its packages, then copy the source from above into `components/kokonutui/lightbox-grid.tsx`.

```bash
npm install motion
```

## Usage

```javascript
import LightboxGrid from "@/components/kokonutui/lightbox-grid";

export default function Example() {
  return <LightboxGrid />;
}
```

## Props

- `images`: `LightboxImage[]` **Default**: `built-in`
- `className`: `string` Extra classes for the root element.

### LightboxImage

- `src`: required `string`
- `alt`: required `string`
- `width`: required `number` Natural size, used to fit the open view without waiting for a load.
- `height`: required `number`
- `caption`: `string`

## Dependencies

| Needs | Version | Comes from |
| --- | --- | --- |
| `motion` | `^12.23.25` | npm, installed by the CLI |
| `cn` from `lib/utils.ts` |  | shadcn init |
| React | `19` | Your app |
| Tailwind CSS | `4` | Your app |

No provider, font or global CSS to set up: the file works as soon as it lands.

## Images

- 
- 
- 
- 
- 
-
