How it works
The root is an inline-size container, so columns follow the space the grid really has: four from 640px, two from 360px, one below. grid-auto-flow: dense backfills holes when spans do not line up. On two columns a large tile becomes 2×1; on one column all tiles are 1×1 and stack in source order, which is also the reading and tab order.
Use it for
- A feature overview on a landing or pricing page.
- A dashboard home with a few unequal widgets.
Look elsewhere when
- Long, uniform collections: use a list or a masonry grid.
- Content whose order matters more than its emphasis: dense packing can move small tiles up.
Usage
import { BentoGrid } from './BentoGrid.jsx'
const features = [
{ id: 'plan', span: 'large', eyebrow: 'Planning', title: 'Boards that stay tidy', description: 'Drag work between stages.', visual: <BoardArt /> },
{ id: 'sync', span: 'small', title: 'Live in every tab', visual: <SyncArt /> },
{ id: 'privacy', span: 'small', title: 'Private by default' },
{ id: 'report', span: 'wide', title: 'Weekly focus report', href: '/reports' },
]
export function Features() {
return <BentoGrid items={features} gap={12} />
}Props
| Prop | Type | Default | What it does |
|---|---|---|---|
items | { id?, span?, eyebrow?, title, description?, visual?, tone?, href?, onClick? }[] | — | The tiles. span is 'small' (1×1), 'wide' (2×1), 'tall' (1×2) or 'large' (2×2); tone 'accent' or 'ink' changes the fill. With href or onClick the tile is a link or button. |
gap | number | 12 | Space between tiles in px. |
rowHeight | number | 152 | Minimum row height in px; rows grow to fit their content. |
spotlight | boolean | true | A soft accent glow that follows the pointer on hover. |
...rest | HTMLAttributes<HTMLDivElement> | — | Passed to the root, which is the size container. |
Accessibility
- The grid is a list (ul / li), so screen readers announce the number of tiles.
- Tiles with href render as links and with onClick as buttons, with a 4px accent focus ring; others are plain content.
- Dense packing changes only the visual position; keep the source order meaningful.
- Reduced motion replaces the staggered rise with a 200ms fade and removes the hover lift.
Motion
Tiles rise 12px from scale 0.98 over 560ms ease-out, 50ms apart. Interactive tiles lift 2px with a deeper shadow in 260ms; the spotlight fades in over 320ms.
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the component next to your own.
BentoGrid.jsxbento-grid.csstokens.cssREADME.md
Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.





