Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

React Bento Grid with Tailwind CSS: Layout and Animation

Build a responsive React bento grid with Tailwind CSS grid and add Framer Motion hover and scroll animation, with accessible markup and ready-made options.

A bento grid is a layout where content sits in tiles of different sizes that fit together like the compartments of a bento box: one large tile, a few small ones, a wide one to finish the row. It is popular for feature sections and dashboards because it lets one tile lead and the rest support it, instead of repeating the same card six times.

This guide builds a React bento grid with Tailwind CSS in two steps: the layout, using CSS grid, and then the motion, using Framer Motion. The code is React with TypeScript, and both components were typechecked before they went on this page. If you would rather install a finished one, the ready-made bento grids are listed near the end.

What makes a bento grid work

A bento grid is not a special component. It is a CSS grid where some items span more than one column or row. Three decisions do most of the work:

  • A fixed row height. If every row has the same height, tiles line up and the spans do the rest. Tailwind's auto-rows-[12rem] sets this.
  • A hierarchy of sizes. One large tile, a couple of medium ones and the rest small. If every tile is the same size it is just a card grid.
  • A single column on phones. Spans only make sense when there is room, so apply them from the md breakpoint up.

Step 1: the layout

This grid has three columns on wider screens and nine cells in total. The first tile takes a 2 by 2 block, two small tiles stack beside it, and the last row holds one small tile and one wide tile.

type Tile = {
  title: string;
  body: string;
  className?: string;
};

const tiles: Tile[] = [
  {
    title: "Ships fast",
    body: "Copy the source into your project and start editing it.",
    className: "md:col-span-2 md:row-span-2",
  },
  { title: "Typed", body: "Props are fully typed." },
  { title: "Accessible", body: "Keyboard and screen reader friendly." },
  { title: "Themeable", body: "Colours come from CSS variables." },
  {
    title: "Animated",
    body: "Motion that respects reduced motion settings.",
    className: "md:col-span-2",
  },
];

export function BentoGrid() {
  return (
    <ul className="grid auto-rows-[12rem] grid-cols-1 gap-4 md:grid-cols-3">
      {tiles.map((tile) => (
        <li
          key={tile.title}
          className={`rounded-2xl border border-border bg-card p-6 ${tile.className ?? ""}`}
        >
          <h3 className="text-lg font-semibold">{tile.title}</h3>
          <p className="mt-2 text-sm text-muted-foreground">{tile.body}</p>
        </li>
      ))}
    </ul>
  );
}

A few things are worth noticing. The grid is a list, ul and li, because a set of tiles is a list and a screen reader announces how many there are. The spans are written as full class names inside the data, not built from strings, because Tailwind only generates classes it can find written out in your source. And on a phone the grid is one column, so the spans do nothing and the tiles simply stack.

Step 2: animate it with Framer Motion

Motion in a bento grid should help people read it, not distract them. Two small effects are enough: tiles fade up as they scroll into view, and a tile lifts slightly when you hover it.

"use client";

import { motion, useReducedMotion } from "framer-motion";

type Tile = {
  title: string;
  body: string;
  className?: string;
};

export function AnimatedBentoGrid({ tiles }: { tiles: Tile[] }) {
  const reduce = useReducedMotion();

  return (
    <ul className="grid auto-rows-[12rem] grid-cols-1 gap-4 md:grid-cols-3">
      {tiles.map((tile, i) => (
        <motion.li
          key={tile.title}
          initial={reduce ? false : { opacity: 0, y: 16 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true, margin: "-40px" }}
          transition={{ type: "spring", stiffness: 260, damping: 26, delay: i * 0.06 }}
          whileHover={reduce ? undefined : { y: -4 }}
          className={`rounded-2xl border border-border bg-card p-6 ${tile.className ?? ""}`}
        >
          <h3 className="text-lg font-semibold">{tile.title}</h3>
          <p className="mt-2 text-sm text-muted-foreground">{tile.body}</p>
        </motion.li>
      ))}
    </ul>
  );
}

useReducedMotion returns true when someone has asked their system for less motion. In that case the tiles appear in place with no fade and no lift. The delay grows with the tile's index so the grid builds up tile by tile, and once: true plays the entrance a single time, so scrolling back up does not replay it.

Making a bento grid look good

  • Keep the gap consistent. One gap value, usually gap-4, makes the tiles read as one object.
  • Put the most important content in the biggest tile. People read the large tile first.
  • Do not fill every tile with a picture. Mix a screenshot, a stat, a short line of text and a small chart, so the grid has rhythm.
  • Test the single-column order. On a phone the tiles stack in source order, so the first tile in your array is the first one people see.
  • Check contrast on every tile. Tiles with tinted or gradient backgrounds need text that stays readable at 4.5 to 1.

Ready-made React bento grids

If you need a bento grid today, these are finished options.

From Nexus UI. This is our own component, built with React, Tailwind CSS and Framer Motion and installed as source with the shadcn CLI. It is Pro.

  • Why Choose Us Bento Grid: a feature bento collection with ten variants. Animated Bento Grid is a grid of stat tiles whose digits roll in like odometers when it scrolls into view. Signal Bento Grid is a service health bento with a live latency line, 30 days of uptime bars and edge region health. The others cover mentoring cards, scoring, upload flows and progress tracking.

For a wider comparison of libraries, see the best React component library guide.

Frequently asked questions

What is a bento grid?

A bento grid is a layout of tiles in different sizes that fit together in a grid, named after the compartments of a bento lunch box. Most are built with CSS grid, where some tiles span two columns or two rows.

How do I make a bento grid in Tailwind CSS?

Use grid with a fixed row height such as auto-rows-[12rem], set the columns with grid-cols-3 from a breakpoint up, and give the larger tiles col-span-2 or row-span-2. Keep a single column on small screens.

Is a bento grid good for accessibility?

It can be, if the tiles are real list items in a sensible reading order, the text has enough contrast and any motion respects the reduced motion setting. The layout itself does not change what a screen reader reads: it follows source order.

Do I need a library for a bento grid?

No. The layout is plain CSS grid, and the two components above are all you need for a responsive, animated one. A library saves time when you want finished tiles such as charts, counters and previews.

Where to go from here

Start with the layout and get the hierarchy of sizes right before adding any motion. Then add the entrance and hover effects, and test the grid with the keyboard and with reduced motion switched on. For more on animation, see the Framer Motion examples guide.

Build it with the components from this guide.