Components

Bento Grid

A responsive bento grid for React and Tailwind CSS, made for feature sections and landing pages. Cards span columns and rows, and on hover or keyboard focus the border and background visual brighten and the content lifts to reveal a call to action. Each linked card is a single, focusable link.

  • Responsive spans
  • Hover reveal CTA
  • Whole-card links
  • Next.js Link support
  • prefers-reduced-motion

Installation

$ npx shadcn@latest add https://duskui.com/r/bento-grid.json

Usage

features.tsx
import Link from "next/link"
import { Globe, Rocket } from "lucide-react"
import { BentoCard, BentoGrid } from "@/components/dusk/bento-grid/bento-grid"

export function Features() {
  return (
    <BentoGrid columns={3}>
      <BentoCard
        colSpan={2}
        href="/docs/deploy"
        linkAs={Link}
        icon={<Rocket />}
        title="Deploy in one command"
        description="Push to main and you're live everywhere."
        cta="Read the guide"
      />
      <BentoCard
        rowSpan={2}
        href="/docs/edge"
        linkAs={Link}
        icon={<Globe />}
        title="Global edge"
        description="Served from the closest region."
      />
    </BentoGrid>
  )
}

Examples

Four columns, static cards

columns sets the column count on large screens (tablets get two, phones one). Cards without href are plain containers: they keep the hover border and background change but show no call to action. Change the row height with an auto-rows-* class.

AI assistant

Ask questions about your codebase and get answers with links to the exact lines.

Postgres

Serverless, branching.

GPU jobs

Pay per second.

Branch previews

Every pull request gets a live URL.

SOC 2

Audited yearly.

Alerts

Slack, email, webhooks.

Monorepo aware

Only rebuild what changed.

API Reference

BentoGrid takes columns (2 | 3 | 4, default 3) plus any div attribute. BentoCard takes the props below plus any HTML attribute.

PropTypeDefaultDescription
titleReactNode—Card heading.
descriptionReactNode—Text under the title.
iconReactNode—Small icon above the title.
backgroundReactNode—Decorative visual behind the content; it brightens slightly on hover. Rendered aria-hidden.
hrefstring—Makes the whole card one link.
linkAsElementType"a"Link component for href, e.g. Next.js Link.
ctaReactNode"Learn more"Call to action revealed on hover / focus. Links only; pass null to hide it.
colSpan1 | 2 | 3 | 41Columns to span from sm up, clamped to the grid's columns.
rowSpan1 | 2 | 31Rows to span from sm up.
titleAs"h2" | "h3" | "h4""h3"Heading element for the title.

Accessibility

  • A card with href is a single link: one Tab stop whose accessible name is its title, description and call to action. It has a visible focus ring, and focus triggers the same reveal as hover.
  • Pick the right heading level with titleAs so the cards fit your page outline.
  • The background visual is aria-hidden decoration.
  • On touch screens (no hover) the call to action is always visible, so nothing is hidden behind a hover.
  • With prefers-reduced-motion nothing slides; the call to action and the brighter background only fade in.
  • The reveal is CSS transform and opacity, so hovering never re-renders React.