Best For
bento grid / bento layout / bento box design
Irregular 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)
AI Implementation
Use the Hard Prompt by default to generate UI. Use the Design Spec to understand, modify, and review the style. Use the Creative Brief for early exploration.
Use this by default: copy it, append the concrete requirement, and let AI generate consistent production UI.
When to use
How to use
STYLEKIT_STYLE_REFERENCE
style_name: Bento Grid
style_slug: bento-grid
style_source: /styles/bento-grid
# Hard Prompt
## When To Use
Use this when you want AI to generate code with strict style consistency. It is the safest default for production UI.
## How To Use
- Copy the full prompt into ChatGPT, Claude, Cursor, or another coding assistant.
- Append the concrete product/page requirement after the prompt.
- After generation, check the forbidden rules and interaction states before accepting the output.
Strictly follow the style rules below and maintain consistency. No style drift allowed.
## Requirements
- Prioritize style consistency first, then creative extension.
- When conflicts arise, treat prohibitions as the highest priority.
- Self-check before output: verify colors, typography, spacing, and interactions still match this style.
## Style Rules
You are a Bento Grid design style frontend development expert. All generated code must strictly follow these constraints:
## Absolutely Forbidden
- All cards being the same size (must have size variation)
- Ignoring responsive adaptation
- Inconsistent gaps between cards
- Overcrowded card content
- Using sharp corners (rounded corners required)
- Using hard-edge shadows (shadow-[Xpx_Ypx_0px])
## Must Follow
- Use CSS Grid: grid grid-cols-4
- Card spanning: col-span-2, row-span-2
- Consistent gaps: gap-4 or gap-6
- Rounded corners: rounded-xl, rounded-2xl, rounded-3xl
- Responsive: md:grid-cols-2, lg:grid-cols-4
## Animation & Interaction Rules
- Widget Feel: Each card feels like an independent iOS widget. Smooth hover lift + micro-scale (hover:-translate-y-1 hover:scale-[1.01]), with soft wide shadow (hover:shadow-[0_8px_30px_rgba(0,0,0,0.08)]).
- Micro-interactions: Card inner icons respond independently on group-hover: color swap (bg swap), scale up (scale-110).
- Snappy Easing: Use ease-out with duration-200 to duration-300, making interactions responsive and modern.
- Active Feedback: Press with active:scale-95 or active:scale-98, simulating physical press.
- Smooth Focus: Input focus ring transition is ultra-smooth (transition-all duration-200).
## Layout Rules
Large cards (col-span-2 row-span-2):
- Place primary content or featured functions
- Can use gradient backgrounds
- Recommend 1-2 cards
Medium cards (col-span-2 or row-span-2):
- Secondary important content
- Recommend 2-3 cards
Small cards (1x1):
- Icons, numbers, tags and other brief content
- Fill remaining space
## Color Suggestions
Backgrounds:
- Gradient: bg-gradient-to-br from-blue-500 to-purple-600
- Light: bg-zinc-50, bg-zinc-100
- Colored: bg-orange-50, bg-green-50, bg-blue-50
Text:
- Primary: text-zinc-900
- Secondary: text-zinc-500, text-zinc-600
- White: text-white (on dark backgrounds)
## Self-Check
After generating code, verify:
1. Cards have varying sizes
2. Uses CSS Grid
3. Consistent gaps
4. Has responsive handling
5. Unified rounded corners
6. Cards have hover lift + micro-scale effect
7. Inner icons have group-hover linkage
---
# Bento Grid Design System
> Irregular grid layout inspired by Japanese bento boxes, creating visual hierarchy through varied card sizes. Commonly used for portfolios and product showcases.
## Design Philosophy
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.
Core principles:
- Modularity: Each block is independent yet interconnected
- Hierarchy: Emphasize key content through size differences
- Whitespace: Appropriate gaps let the layout breathe
- Responsive: Gracefully adapt across different screen sizes
- Widget playfulness: Each card feels like an independent iOS widget
---
## Token Dictionary (exact class mapping)
### Border
```
Width: border
Color: border-zinc-100 dark:border-zinc-800
Radius: rounded-2xl
```
### Shadow
```
sm: shadow-sm
md: shadow-md
lg: shadow-lg
hover: hover:shadow-md hover:-translate-y-0.5
focus: focus:shadow-md focus:ring-2 focus:ring-blue-500/20
```
### Interaction
```
Hover translate: hover:-translate-y-0.5
Hover scale: (none)
Hover opacity: (none)
Transition: transition-all duration-200
Active: active:scale-95
```
### Typefaces
```
Heading: font-semibold text-zinc-900 dark:text-zinc-100
Body: text-zinc-600 dark:text-zinc-400
Mono: font-mono
```
### Type scale
```
Hero: text-4xl md:text-5xl lg:text-6xl
H1: text-3xl md:text-4xl
H2: text-2xl md:text-3xl
H3: text-xl md:text-2xl
Body: text-sm md:text-base
Small: text-xs
```
### Spacing
```
Section: py-12 md:py-16 lg:py-20
Container: px-4 md:px-6 lg:px-8
Card: p-4 md:p-6
Gap sm: gap-3 md:gap-4
Gap md: gap-4 md:gap-6
Gap lg: gap-6 md:gap-8
```
### Color roles
```
Background primary: bg-white dark:bg-zinc-900
Background secondary: bg-zinc-50 dark:bg-zinc-800
Background accent: bg-gradient-to-br from-blue-500 to-purple-600, bg-gradient-to-br from-orange-400 to-pink-500, bg-gradient-to-br from-green-400 to-cyan-500
Text primary: text-zinc-900 dark:text-zinc-100
Text secondary: text-zinc-600 dark:text-zinc-400
Text muted: text-zinc-400 dark:text-zinc-500
Button primary: bg-zinc-900 text-white dark:bg-white dark:text-zinc-900
Button secondary: bg-zinc-100 text-zinc-900 dark:bg-zinc-800 dark:text-zinc-100
```
---
## [FORBIDDEN]
These classes are banned in this style. Check for them before returning code:
### Banned classes
- `rounded-none`
- `rounded-sm`
- `gap-1`
- `gap-2`
- `gap-10`
- `gap-12`
### Banned patterns
- matches `^rounded-none`
- matches `^rounded-sm`
### Why they are banned
- `rounded-none`: Bento Grid requires rounded corners (rounded-xl, rounded-2xl, or rounded-3xl)
- `rounded-sm`: Bento Grid uses larger rounded corners for modern look
- `gap-1`: Bento Grid uses consistent medium gaps (gap-4 or gap-6)
> WARNING: if your code contains any of the above, replace it before shipping.
---
## [REQUIRED]
### Every button must include
```
px-4 py-2 md:px-6 md:py-3
rounded-xl
font-medium
transition-colors
```
### Every card must include
```
rounded-2xl
border border-zinc-100 dark:border-zinc-800
shadow-sm
hover:shadow-md hover:-translate-y-0.5
transition-all duration-200
```
### Every input must include
```
bg-zinc-50 dark:bg-zinc-800
border border-zinc-200 dark:border-zinc-700
rounded-xl
focus:outline-none focus:ring-2 focus:ring-blue-500/20
focus:border-blue-500
transition-all
```
---
## [COMPARE] Bento Grid wrong vs right
The wrong examples below stand for generic library defaults that were never adapted to this style. Do not read them as visual suggestions.
### Button
[WRONG] **Wrong** (generic component library default, do not copy):
```html
<button class="{GENERIC_LIBRARY_BUTTON_DEFAULT}">
Click me
</button>
```
[CORRECT] **Right** (uses this style's tokens):
```html
<button class="px-4 py-2 md:px-6 md:py-3 rounded-xl font-medium transition-colors bg-zinc-900 text-white dark:bg-white dark:text-zinc-900">
Click me
</button>
```
### Card
[WRONG] **Wrong** (generic card, not adapted to this style):
```html
<div class="{GENERIC_LIBRARY_CARD_DEFAULT}">
<h3>{TITLE}</h3>
</div>
```
[CORRECT] **Right** (uses this style's card tokens):
```html
<div class="rounded-2xl border border-zinc-100 dark:border-zinc-800 shadow-sm hover:shadow-md hover:-translate-y-0.5 transition-all duration-200 p-4 md:p-6">
<h3 class="font-semibold text-zinc-900 dark:text-zinc-100 text-xl md:text-2xl">{TITLE}</h3>
</div>
```
### Input
[WRONG] **Wrong** (generic input, not adapted to this style):
```html
<input class="{GENERIC_LIBRARY_INPUT_DEFAULT}" />
```
[CORRECT] **Right** (uses this style's input tokens):
```html
<input class="bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" placeholder="{PLACEHOLDER}" />
```
---
## [TEMPLATES] Bento Grid page skeletons
These skeletons use this style's tokens only. Replace `{PLACEHOLDER}` values, but keep every token in place:
### Navigation
```html
<nav class="bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 border border-zinc-100 dark:border-zinc-800 px-4 md:px-6 lg:px-8">
<div class="flex items-center justify-between max-w-6xl mx-auto gap-4 md:gap-6">
<a href="/" class="font-semibold text-zinc-900 dark:text-zinc-100 text-xl md:text-2xl">
{LOGO_TEXT}
</a>
<div class="flex gap-4 md:gap-6 text-zinc-600 dark:text-zinc-400 text-xs">
{NAV_LINKS}
</div>
</div>
</nav>
```
### Hero section
```html
<section class="bg-gradient-to-br from-blue-500 to-purple-600 text-zinc-900 dark:text-zinc-100 py-12 md:py-16 lg:py-20 px-4 md:px-6 lg:px-8">
<div class="max-w-4xl mx-auto">
<h1 class="font-semibold text-zinc-900 dark:text-zinc-100 text-4xl md:text-5xl lg:text-6xl">
{HEADLINE}
</h1>
<p class="text-zinc-600 dark:text-zinc-400 text-sm md:text-base max-w-xl">
{SUBHEADLINE}
</p>
<button class="px-4 py-2 md:px-6 md:py-3 rounded-xl font-medium transition-colors bg-zinc-900 text-white dark:bg-white dark:text-zinc-900">
{CTA_TEXT}
</button>
</div>
</section>
```
### Card grid
```html
<section class="bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 py-12 md:py-16 lg:py-20 px-4 md:px-6 lg:px-8">
<div class="max-w-6xl mx-auto">
<h2 class="font-semibold text-zinc-900 dark:text-zinc-100 text-2xl md:text-3xl">{SECTION_TITLE}</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6">
<!-- Card template - repeat for each card -->
<div class="rounded-2xl border border-zinc-100 dark:border-zinc-800 shadow-sm hover:shadow-md hover:-translate-y-0.5 transition-all duration-200 p-4 md:p-6">
<h3 class="font-semibold text-zinc-900 dark:text-zinc-100 text-xl md:text-2xl">{CARD_TITLE}</h3>
<p class="text-zinc-600 dark:text-zinc-400 text-sm md:text-base text-zinc-400 dark:text-zinc-500">{CARD_DESCRIPTION}</p>
</div>
</div>
</div>
</section>
```
### Form input
```html
<input class="bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all" placeholder="{PLACEHOLDER}" />
```
### Footer
```html
<footer class="bg-zinc-50 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400 py-12 md:py-16 lg:py-20 px-4 md:px-6 lg:px-8">
<div class="max-w-6xl mx-auto">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 md:gap-8">
<div>
<span class="font-semibold text-zinc-900 dark:text-zinc-100 text-xl md:text-2xl">{LOGO_TEXT}</span>
<p class="text-zinc-600 dark:text-zinc-400 text-xs">{TAGLINE}</p>
</div>
<div>
<h4 class="font-semibold text-zinc-900 dark:text-zinc-100 text-xl md:text-2xl">{COLUMN_TITLE}</h4>
<ul class="text-zinc-600 dark:text-zinc-400 text-xs">
{FOOTER_LINKS}
</ul>
</div>
</div>
</div>
</footer>
```
---
## [CHECKLIST] Bento Grid post-generation self check
**Before returning code, verify every token and rule below. Fix any violation before delivering:**
### Token check
- [ ] Button includes: `px-4 py-2 md:px-6 md:py-3 rounded-xl font-medium transition-colors`
- [ ] Card includes: `rounded-2xl border border-zinc-100 dark:border-zinc-800 shadow-sm hover:shadow-md hover:-translate-y-0.5 transition-all duration-200`
- [ ] Input includes: `bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all`
### Forbidden check
- [ ] Not using `rounded-none`
- [ ] Not using `rounded-sm`
- [ ] Not using `gap-1`
- [ ] Not using `gap-2`
- [ ] Not using `gap-10`
- [ ] Not using `gap-12`
### Style rule check
- [ ] Use CSS Grid layout grid grid-cols-4
- [ ] Cards span multiple rows or columns col-span-2, row-span-2
- [ ] Maintain consistent gaps gap-4 or gap-6
- [ ] Use rounded corners rounded-xl or rounded-2xl
- [ ] Place primary content in large cards, secondary info in small cards
### Style drift check
- [ ] Does not violate: Do not make all cards the same size (loses Bento character)
- [ ] Does not violate: Do not use inconsistent gaps
- [ ] Does not violate: Do not overcrowd cards without whitespace
- [ ] Does not violate: Do not ignore responsive adaptation
- [ ] Does not violate: Do not cram too much content inside cards
### Delivery check
- [ ] Responsive layout holds on phone, tablet and desktop with no horizontal overflow
- [ ] Every interactive element has a visible focus state, an accessible name and a reduced-motion path
- [ ] Text contrast meets WCAG AA and colour alone never carries state
- [ ] The result is still recognizable at a glance as Bento Grid
## Absolute Bans (Match and Refuse)
If any of the following patterns appear, it is a style violation — rewrite without exception.
- make all cards the same size (loses Bento character)
- use inconsistent gaps
- overcrowd cards without whitespace
- ignore responsive adaptation
- cram too much content inside cards
- use hard-edge shadows (shadow-[Xpx_Ypx_0px])
- use sharp corners (rounded corners required)
## Self-Check (Verify Before Shipping)
If any item fails, the style has drifted — fix before shipping.
- [ ] No purple-to-blue gradients
- [ ] No overused fonts (Inter, Roboto, Geist, Fraunces, Plus Jakarta Sans)
- [ ] No nested cards (cards inside cards)
- [ ] No gray text on colored backgrounds
- [ ] Body text contrast meets WCAG AA (>= 4.5:1)
- [ ] No bounce or elastic easing curves
- [ ] Animations have a prefers-reduced-motion fallback
- [ ] Body text line length capped at 65-75 characters
- [ ] No side-stripe accent borders (border-left/right > 1px)
- [ ] No gradient text (background-clip: text)
- [ ] No glassmorphism used as the default surface treatment
- [ ] No tiny uppercase tracked eyebrow labels above every section heading
- [ ] do not make all cards the same size (loses Bento character)
- [ ] do not use inconsistent gaps
- [ ] do not overcrowd cards without whitespace
- [ ] do not ignore responsive adaptation
- [ ] do not cram too much content inside cardsComponent Templates
Bento 风格按钮,微上浮 + 阴影扩散
Frontend Readiness
This layer tracks whether the style is ready for real websites: theme modes, state feedback, keyboard access, and performance constraints.
Overall
73%
Curated
Dark Mode
70%
PartialUI States
85%
PartialMotion
70%
PartialA11y
70%
PartialPerformance
70%
PartialButton
Default / Hover / Focus Visible / Active / Disabled
Input
Default / Hover / Focus Visible / Disabled / Error
Card
Default / Hover / Focus Visible / Loading / Skeleton
Form
Default / Focus Visible / Disabled / Loading / Error
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.
IDE Integration
Download configuration files for AI coding assistants to generate code in this style.
Style Pack
Get complete machine-readable style assets including design tokens, Tailwind presets, CSS variables, and shadcn/ui themes.
Metadata
Style metadata including version information
Design Tokens
Compatible with Figma / Style Dictionary / Tokens Studio
Tailwind Preset
Tailwind CSS theme preset, import directly in config
Global CSS
CSS variables and base styles
shadcn Theme
shadcn/ui theme configuration
CSS Variables
Pure CSS variables, works with any project
SKILL.md
Loadable skill pack for Cursor / Claude Code / VS Code
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.
WCAG 2.1 compliance analysis based on color contrast and typography readability.
Overall Score
Grade: A - Excellent
Contrast Ratios
| Context | Colors | Ratio | AA | AAA |
|---|---|---|---|---|
| Button primary | /#ffffff / #18181b | 17.72:1 |
Readability
Score
82/100
Font Size
text-sm md:text-base
Font Weight
font-semibold text-zinc-900 dark:text-zinc-100
Line Height
default
Scoring is based on WCAG 2.1 standards. AA requires 4.5:1 contrast for normal text, 3:1 for large text; AAA requires 7:1 for normal text, 4.5:1 for large text.
Design Recipes
These curated recipes combine this style with layouts and animations, optimized for specific use cases.