StealThis .dev

Bento Grid

Responsive bento-style grid layout with varied cell sizes, some spanning multiple columns or rows, for modern dashboard and showcase designs.

Labで開く
css javascript vue svelte
ターゲット: TS JS HTML React Vue Svelte

コード

Bento Grid

A responsive bento-style grid layout inspired by Apple’s design language. Cells can span multiple columns or rows to create visual hierarchy, perfect for dashboards and feature showcases.

How it works

  1. CSS Grid with grid-template-columns: repeat(3, 1fr) creates the base layout
  2. Items use grid-column: span 2 or grid-row: span 2 for varied sizes
  3. Responsive breakpoints collapse to fewer columns on smaller screens
  4. Each item has a consistent card style with dark theme

Customization

  • Add col-span-2 or row-span-2 classes to items for larger cells
  • Adjust --bento-gap for spacing between cells
  • Grid columns change at responsive breakpoints (3 cols -> 2 -> 1)

When to use it

  • Feature showcase sections
  • Dashboard widgets layout
  • Portfolio or project grids