# Bento Grid

> A responsive bento grid for feature sections: tiles with icon, title, copy and a visual slot on a six column grid that collapses to one column on phones.

- Kind: Component (Landing pages)
- Docs: https://ui.minidev.pro/docs/bento-grid
- Source (registry JSON with the full file): https://ui.minidev.pro/r/bento-grid.json
- License: MIT. One file, yours to edit after install.

## When to use

Use on landing pages to show four to seven product features. Each tile has an icon, title, copy and an optional `visual`; tiles with `href` become links. Prefer [`FeatureGrid`](https://ui.minidev.pro/docs/feature-grid) for equal tiles. Server component friendly, no motion, no client JavaScript.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/bento-grid
```

Writes `components/ui/bento-grid.tsx` and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/bento-grid.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { BentoGrid } from "@/components/ui/bento-grid"
```

From the npm package:

```tsx
import { BentoGrid } from "minidev-ui-kit/ui/bento-grid"
```

## Usage

```tsx
import { BentoGrid } from "@/components/ui/bento-grid"

export function Example() {
  return (
    <BentoGrid />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `items` | `BentoItem[]` | `DEMO` | no | Tiles in reading order. Omit for sample data. |
| `className` | `string` | - | no |  |

## Examples

### Custom items

Each item takes a title, copy, an icon and a span out of six columns; rows 2 makes a tall tile.

```tsx
<BentoGrid
  items={[
    { title: "Paid in 140 currencies", description: "Customers pay in their own currency and you settle in yours, at the rate locked on send.", icon: GlobeIcon, span: 4, rows: 2 },
    { title: "Reminders that send themselves", description: "Three days before, seven days after, then stop.", icon: BellIcon, span: 2 },
    { title: "Cards and bank transfer", description: "Every rail your customers already use.", icon: CreditCardIcon, span: 2 },
  ]}
/>
```

### Linked tiles

Give an item an href and the tile becomes a link with a hover border and a focus ring.

```tsx
<BentoGrid
  items={[
    { title: "Automations", description: "Trigger a workflow from any invoice event.", icon: ZapIcon, span: 2, href: "#automations" },
    { title: "Security", description: "SSO, SCIM and audit logs on every plan.", icon: ShieldCheckIcon, span: 2, href: "#security" },
    { title: "Reporting", description: "Revenue, churn and cash flow without a spreadsheet.", icon: TrendingUpIcon, span: 2, href: "#reporting" },
  ]}
/>
```

### Custom visuals

The visual slot takes any node, so a tile can hold a chart, a list or a screenshot.

```tsx
<BentoGrid
  items={[
    {
      title: "Revenue in real time",
      description: "Every chart updates as payments land.",
      icon: TrendingUpIcon,
      span: 4,
      visual: <AreaChart label="Revenue" className="mt-6 h-24" />,
    },
    {
      title: "Status at a glance",
      description: "Open, paid and overdue, always current.",
      icon: BellIcon,
      span: 2,
      visual: (
        <ul className="mt-auto flex flex-col gap-2 pt-6 text-sm">
          <li className="flex items-center justify-between"><span className="font-mono text-xs text-fg-muted">INV-2041</span><Badge variant="accent">Paid</Badge></li>
          <li className="flex items-center justify-between"><span className="font-mono text-xs text-fg-muted">INV-2042</span><Badge variant="outline">Pending</Badge></li>
          <li className="flex items-center justify-between"><span className="font-mono text-xs text-fg-muted">INV-2038</span><Badge variant="destructive">Overdue</Badge></li>
        </ul>
      ),
    },
  ]}
/>
```

## Accessibility

- Each tile title is an `<h3>`, so a page with an `<h2>` above the grid keeps a clean heading outline.
- Tile icons and the default bar chart are `aria-hidden`.
- A tile with `href` becomes one `<a>` whose name is its title plus description. Do not put other links or buttons inside it.

## FAQ

### How do I make one tile bigger than the others?

Set `span` (2, 3, 4 or 6 columns out of 6) and `rows` (1 or 2) on that item. Spans only apply at the `lg` breakpoint: below it the grid is one column on phones and two on tablets, and the first tile always spans both tablet columns.

### Can I put my own chart or screenshot in a tile?

Pass it as `visual` on the item and it renders under the description. A tile with `rows: 2` and no `visual` gets a small decorative bar chart. Pass `visual: null` to keep the tall tile with no art.

### Does BentoGrid work in a Next.js Server Component?

Yes. The file has no `"use client"` directive, no state and no motion, so it renders on the server with no JavaScript sent. `icon` takes a lucide component (`icon: BellIcon`), not an element. For a version with live, animated tiles use [`BentoLive`](https://ui.minidev.pro/docs/bento-live).

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`

## Related

- [Feature Grid](https://ui.minidev.pro/docs/feature-grid/md): A responsive grid of feature cards, one to three columns wide, each with an optional icon, a title and a short description. Built with React and Tailwind.
- [Announcement Bar](https://ui.minidev.pro/docs/announcement-bar/md): Slim site-wide announcement bar for launches, promos or notices. Centered content, a polite status role for screen readers and an optional dismiss button.
- [Blog Card](https://ui.minidev.pro/docs/blog-card/md): Linked Tailwind blog post card with a 16:9 cover image, tag, relative date, title and a two line clamped excerpt. Hover and focus states cover the card.
- [Case Study Card](https://ui.minidev.pro/docs/case-study-card/md): Case study card with the company name, a short headline and a large result metric, plus an optional up or down delta. Good for proof sections on landing pages.
- [Cookie Banner](https://ui.minidev.pro/docs/cookie-banner/md): Floating React cookie consent card fixed to the corner, with a short notice and Accept and Reject buttons. It is a labelled dialog for assistive tech.
- [Cta Banner](https://ui.minidev.pro/docs/cta-banner/md): Tailwind call to action banner with a heading, supporting text and a primary button that stacks on mobile and sits in a row on wider screens.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
