BentoGrid

Mixed-size tiles that rise in as a stagger, lift on hover, with a light that trails the cursor. Layout.

Open playground

Fast by default

Springs, not tweens.

Accessible

Reduced motion everywhere.

Themeable

One set of CSS variables.

Copy in

One import.

About

BentoGrid is a React component in the Layout category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { BentoGrid } from "@ashutoshswamy/smoui" and set items, columns.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { BentoGrid } from "@ashutoshswamy/smoui";

<BentoGrid columns={3} items={[{ id: "a", title: "Fast by default", span: { cols: 2 }, palette: 1 }, { id: "b", title: "Accessible", span: { rows: 2 } }]} />

Props 2

items

Tiles. palette puts a tile on grainy mesh.

{ id; title; description?; span?: { cols?: 1|2|3; rows?: 1|2 }; palette?; children? }[]
columns / row

Grid columns and row height in px.

numberdefault 3 / 150