Back to elements
ElementLayoutFree

Bento Grid React component

A bento layout of feature cells that span columns and rows, fall back to two and then one column as the container narrows, fade in one after another, and light up under the pointer, with a demo set of small live visuals.

When to use the Bento Grid component

Use Bento Grid for feature overviews, product highlights and 'why us' sections where some points deserve more room than others. Big cells carry the headline feature; small ones round out the story.

Give each cell one idea and a visual; for a stream of same-sized items use a regular grid or Masonry Grid.

Installation

Add the Bento Grid component to your project with the shadcn CLI. It lands in components/bento-grid.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add https://reactframe.com/r/bento-grid.json

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Props

<BentoGrid /> accepts 6 props, all optional.

  • children

    BentoCell children. Leave out for the demo layout.

    React.ReactNode
  • columns

    Columns on wide containers; drops to 2, then 1, as the container narrows.

    number
    Default: 4
  • rowHeight
    number
    Default: 170
  • gap
    number
    Default: 12
  • theme
    "dark" | "light"
    Default: "dark"
  • className
    string

FAQ

How do cells get bigger?
Set colSpan and rowSpan on a BentoCell. Spans are clamped to the available columns, so a 2-wide cell still fits when the grid drops to one column.
What happens on small screens?
The grid watches its own width: below 820px it uses two columns and below 520px one, where cells take their natural height.
Can cells be links?
Yes. Give a cell an href and the whole cell becomes the link, with the same hover light.

More Layout components

Sticky Header
Free
Masonry Grid
Free
Section Container
Free
Panel
Free
Shape Divider
Free
Toolbar
Free