Spectra Frame, animated React component
A photo grid that rests in black and white. Pointing at a photo blooms colour out from where the pointer came in while the photo widens, its row grows and the rest dim; moving off drains the colour back to where the pointer left.
- Free
- Cards
- Hover
- Spring
Like Spectra Frame? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Spectra Frame stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| images | SpectraImage[] | 8 drawn scenes | Photos in reading order, each { src?, alt }. Without src a drawn scene is used. alt is the caption and accessible name. |
| imageCount | number | 8 | How many images to show (slices images). |
| columns | number | 4 | Photos per row. |
| gap | number | 8 | Gap between photos, in px. |
| borderRadius | number | 16 | Corner radius of each photo, in px. |
| padding | number | 0 | Padding round the grid, in px. |
| backgroundColor | string | "transparent" | Background behind the grid. |
| grayscaleIntensity | number | 100 | How grey the resting photos are, 0 to 100. |
| scaleAmount | number | 1.06 | Zoom of the open photo. |
| cellMinHeight | number | 128 | Resting row height, in px. |
| hoveredMinHeight | number | 176 | Height of the row holding the open photo, in px (the grid keeps its total height). |
| expandedFlex | number | 2.2 | How much wider the open photo grows than its neighbours. |
| onSelect | (index: number) => void | — | Called with the index when a photo is clicked or activated with the keyboard. |
| hint | string | "Point at a photo." | Caption under the grid. An empty string hides it. |
| autoplay | boolean | false | Opens each photo in turn until someone touches the grid. |
| className | string | — | Extra classes for the root. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/spectra-frame
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/spectra-frame/index.tsspectra-frame.tsx - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { SpectraFrame } from "@/components/spectra-frame"; export default function Page() { return ( <main> <SpectraFrame /> </main> ); }
Like Spectra Frame? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Spectra Frame stays free.
About Spectra Frame
Spectra Frame is a responsive image grid where photos are desaturated to black and white by default and burst into full color on hover with an adaptive scale animation. The color reveal uses CSS filter transitions without any JavaScript per-frame work. The component has zero external dependencies and uses scoped CSS injection, with picsum placeholder images by default. Responsive columns adapt to container width, making it suitable for any grid layout within a Next.js page.
Good for
- Photography portfolio galleries
- Product and brand photo showcases
- Creative agency portfolio grids
- Visual product feature galleries