Bento Grid, animated React component
A free React bento grid in Tailwind CSS: tiles of different sizes where one soft light follows the pointer across all of them, so the grid reads as a single surface. Tiles rise in one after another when scrolled into view, lift on hover, and take any React node as their visual. Light or dark.
- Free
- Bento Grids
- Hover
- Spring
- Scroll
Like Bento Grid? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Bento Grid stays free.
Set it up, copy the code
Choose values for the main props and the JSX on the right updates to match.
Light or dark tiles.
A ghost light drifts across the tiles until the visitor touches the grid. Never runs under reduced motion.
Your JSX
<BentoGrid
tone="light"
autoplay={false}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| items | BentoItem[] | demo tiles | The tiles: { id?, title, description, visual?, cols?, rows?, href? }. cols is 1 to 3 and rows is 1 or 2. |
| tone | "light" | "dark" | "light" | Light or dark tiles. |
| autoplay | boolean | false | A ghost light drifts across the tiles until the visitor touches the grid. Never runs under reduced motion. |
| className | string | "" | Extra classes for the grid. |
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/bento-grid
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/bento-grid/bento-grid.tsxindex.ts - 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 { BentoGrid } from "@/components/bento-grid"; export default function Page() { return ( <main> <BentoGrid /> </main> ); }
Like Bento Grid? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Bento Grid stays free.
Bento Grid questions
How do I install the bento grid?
Run `npx shadcn@latest add @nexus-labs/bento-grid`. It adds the component and installs framer-motion.
How do I make tiles different sizes?
Give each item `cols` (1 to 3) and `rows` (1 or 2). The grid has three columns from tablet width up, two on small screens and one on phones.
What can I put in a tile?
Anything. Pass a React node as `visual`: a chart, a form, an image, a video or your own component. The title and description sit under it.
How do I make a tile a link?
Add `href` to the item. A link covers the whole tile and uses the title as its accessible name.
Does it work in dark mode?
Set `tone="dark"` for dark tiles. Both tones use fixed colours, so they look the same whatever the page theme is.