Best For
bento grid / bento layout / bento box design
便当盒布局
Rate this styleIrregular grid layout inspired by Japanese bento boxes, creating visual hierarchy through varied card sizes. Commonly used for portfolios and product showcases.
Best For
bento grid / bento layout / bento box design
Primary Move
Use CSS Grid layout grid grid-cols-4
Watch Out
Do not make all cards the same size (loses Bento character)
design.md
One document describes the colour roles, type rules, spacing and component construction behind this style. Copy or download it into Claude Code or Codex.
Uneven cards on one shared grid, ranking themselves by size rather than by color.
Theme: light
Bento treats the page as a four-column grid where cards span one column, two columns or two rows, and size itself is the hierarchy: the largest cell holds the main feature, the smallest the footnote. Gaps must stay uniform (16px or 24px) or the grid falls apart. Cards share a 24px radius, a hairline border and a shadow you can barely see; hover lifts 4px, scales 1% and widens the shadow to 0 8px 30px, like lifting a real box. A few cards may carry a gradient as a visual anchor, never more than two per screen.
| Name | Value | Token | Role |
|---|---|---|---|
| Ink | #18181b | --color-ink | Headings, primary buttons and the dark anchor card — the contrast baseline for the whole grid. |
| Snow | #fafafa | --color-snow | Page canvas. Cards sit one step brighter so luminance does the lifting. |
| Card White | #ffffff | --color-card | Every card fill. No grey cards; level is decided by size and content alone. |
| Sky | #3b82f6 | --color-sky | Primary emphasis and icon grounds, used on one anchor card or one icon set. |
| Violet | #8b5cf6 | --color-violet | Second accent, appearing only beside sky inside a gradient anchor card. |
| Tangerine | #f97316 | --color-tangerine | Figures and alerts. One per screen, placed in a small cell. |
| Role | Family | Weight | Size | Line Height | Letter Spacing | Token |
|---|---|---|---|---|---|---|
| display | — | 700 | 32px | 1.15 | -0.02em | --text-display |
| heading | — | 600 | 24px | 1.25 | — | --text-heading |
| body-lg | — | 500 | 16px | 1.5 | — | --text-body-lg |
| body | — | 400 | 14px | 1.6 | — | --text-body |
| label | — | 500 | 12px | 1.4 | 0.02em | --text-label |
Base unit: 8px Density: comfortable
| Name | Value | Token |
|---|---|---|
| 8 | 8px | --spacing-8 |
| 16 | 16px | --spacing-16 |
| 24 | 24px | --spacing-24 |
| 32 | 32px | --spacing-32 |
| 48 | 48px | --spacing-48 |
| 64 | 64px | --spacing-64 |
| 96 | 96px | --spacing-96 |
| Element | Value |
|---|---|
| cards | 24px |
| buttons | 12px |
| inputs | 12px |
| icons | 16px |
Role: Any single card in the grid
White fill, 24px radius, 1px #f4f4f5 border, 24px padding (32px in large cells), shadow 0 2px 10px at 2%. Cells default to one column and may span two columns or two rows. Hover lifts 4px, scales 1.01 and widens the shadow to 0 8px 30px at 8%, over 300ms ease-out.
Role: The main feature cell, usually 2x2
Ink fill or a 135-degree sky-to-violet gradient, white text, 32px padding. Title at 24px/600, body at 14px in 80% white. The icon tile is 48px square with a 16px radius on 12% white. Hover carries a tinted shadow (30% sky) and lifts 4px. One per screen.
Role: Page-level grid container
One column on mobile, two on tablet, four on desktop; gaps are a single value per page, 16px or 24px. Rows use grid-auto-rows pinned to multiples of 180px so spanning cards keep their proportions.
Role: Buttons and links inside a cell
Ink fill, white text, 12px radius, 14px type at weight 500, 8px 18px padding, one shadow step. Hover shifts to 80% ink and lifts 2px; press scales to 0.95. Inside a dark card, invert to a white fill with ink text.
| Level | Name | Value | Purpose |
|---|---|---|---|
| 0 | Snow | #fafafa | 页面画布 |
| 1 | Card White | #ffffff | 标准卡片 |
| 2 | Ink Anchor | #18181b | 主功能卡,全屏不超过一张 |
0 2px 10px rgba(0,0,0,0.02)0 8px 30px rgba(0,0,0,0.08)0 12px 40px rgba(59,130,246,0.30)Cells hold product shots, small charts, icon grids and short loops. One anchor card may substitute a gradient for imagery. No large people photography or decorative illustration — both break the grid.
Four columns capped at 1152px, gaps of 16px or 24px, rows based on 180px. Spans must pair up: a 2x2 needs at least two 1x1 neighbours so no row is a single card. On mobile the grid collapses to a single ordered column with the same gap and padding.
QUICK COLOR REFERENCE:
#18181b#fafafa#ffffff#3b82f6#8b5cf6#f4f4f5EXAMPLE COMPONENT PROMPTS:
:root {
/* Colors */
--color-ink: #18181b;
--color-snow: #fafafa;
--color-card: #ffffff;
--color-sky: #3b82f6;
--color-violet: #8b5cf6;
--color-tangerine: #f97316;
/* Typography — Font Families */
--font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
/* Typography — Scale */
--text-display: 32px;
--leading-display: 1.15;
--tracking-display: -0.02em;
--text-heading: 24px;
--leading-heading: 1.25;
--text-body-lg: 16px;
--leading-body-lg: 1.5;
--text-body: 14px;
--leading-body: 1.6;
--text-label: 12px;
--leading-label: 1.4;
--tracking-label: 0.02em;
/* Typography — Weights */
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
/* Spacing */
--spacing-unit: 8px;
--spacing-8: 8px;
--spacing-16: 16px;
--spacing-24: 24px;
--spacing-32: 32px;
--spacing-48: 48px;
--spacing-64: 64px;
--spacing-96: 96px;
/* Layout */
--page-max-width: 1152px;
--section-gap: 64px;
--card-padding: 24px;
--element-gap: 16px;
--density: comfortable;
/* Border Radius */
--radius-cards: 24px;
--radius-buttons: 12px;
--radius-inputs: 12px;
--radius-icons: 16px;
/* Surfaces */
--surface-snow: #fafafa;
--surface-card-white: #ffffff;
--surface-ink-anchor: #18181b;
}
Component Templates
FAQ
/* Bento Grid 全局样式 */
/* 基础 Grid 容器 */
.bento-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}
@media (max-width: 1024px) {
.bento-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 640px) {
.bento-grid {
grid-template-columns: 1fr;
}
}
/* 卡片尺寸变体 */
.bento-lg {
grid-column: span 2;
grid-row: span 2;
}
.bento-wide {
grid-column: span 2;
}
.bento-tall {
grid-row: span 2;
}
/* Widget 卡片悬停 */
.bento-card {
transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
cursor: pointer;
}
.bento-card:hover {
transform: translateY(-4px) scale(1.01);
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.bento-card:active {
transform: scale(0.98);
}
/* 卡片内图标联动 */
.bento-card:hover .bento-icon {
transform: scale(1.1);
}
.bento-icon {
transition: transform 0.3s ease-out, background-color 0.3s ease-out, color 0.3s ease-out;
}
/* Bento Grid Design Tokens */
:root {
--bento-grid-primary: #18181b;
--bento-grid-secondary: #fafafa;
--bento-grid-accent: #3b82f6;
--bento-grid-glow: rgba(24, 24, 27, 0.3);
}
@keyframes bento-grid-fade-in {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes bento-grid-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.bento-grid-card {
position: relative;
overflow: hidden;
}
.bento-grid-card::before {
content: "";
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 0.3s ease;
background: linear-gradient(135deg, rgba(24, 24, 27, 0.05), transparent);
pointer-events: none;
}
.bento-grid-card:hover::before {
opacity: 1;
}
.bento-grid-gradient {
background: linear-gradient(135deg, #18181b, #3b82f6);
}
.bento-grid-gradient-text {
background: linear-gradient(135deg, #18181b, #3b82f6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.bento-grid-frosted {
backdrop-filter: blur(12px) saturate(180%);
-webkit-backdrop-filter: blur(12px) saturate(180%);
background: rgba(24, 24, 27, 0.08);
}
.bento-grid-accent-corner {
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), calc(100% - 2rem) 100%, 0 100%);
}
.bento-grid-animate-in {
animation: bento-grid-fade-in 0.5s ease-out both;
}Compatible Visual Styles
Bento Grid is a layout pattern that can be paired with the following visual styles.
Related Styles
Explore these styles for ready-made tokens and components.
Bento Grid and Dashboard Layout sit closest to each other. The table below gives the real differences in color, use case, and tags, so the choice between them is made on facts.
| Attribute | Bento Grid | Dashboard Layout |
|---|---|---|
| Primary color | #18181b | #111827 |
| Secondary color | #fafafa | #f9fafb |
| Best for | bento grid / bento layout / bento box design | dashboard / dashboard layout / admin panel |
| Unique tags | — | — |
Bento Grid is a modern layout style inspired by the compartmentalized design of Japanese bento boxes. Through combining cards of different sizes within a grid, it creates visual effects that are both orderly and varied.
Design Recipes
These curated recipes combine this style with layouts and animations, optimized for specific use cases.