← Back to Home

Bento Grid

A flexible bento grid layout system for showcasing content in visually appealing card arrangements. Features configurable columns, row heights, gaps, and span support.

Installation

npm install @thomarket/bento-grid

Usage Example

import { BentoGrid, BentoCard } from '@thomarket/bento-grid';

function App() {
  return (
    <BentoGrid columns={4} rowHeight={140} gap={16}>
      <BentoCard label="Large Card" colSpan={2} rowSpan={2}>
        <YourComponent />
      </BentoCard>

      <BentoCard label="Small Card">
        <AnotherComponent />
      </BentoCard>

      <BentoCard href="/link" label="Linked Card">
        <LinkedContent />
      </BentoCard>
    </BentoGrid>
  );
}

Live Demo

Basic Grid (4 columns)

3 cols × 2 rows
3x2
1 col × 2 rows
1x2
2 cols × 1 row
2x1
1×1
1x1
1×1
1x1

3 Column Grid

3 cols
Full Width
2 cols
2/3
1×2
1/3
1×1
1/3
1×1
1/3

Without Labels

No label
No label
No label