Best For
网格 / 卡片 / 不规则
Bento Grid
Irregular grid layout inspired by Japanese bento boxes, creating visual hierarchy through varied card sizes. Commonly used for portfolios and product showcases.
Best For
网格 / 卡片 / 不规则
Primary Move
Use CSS Grid layout grid grid-cols-4
Watch Out
Do not make all cards the same size (loses Bento character)
Showcase Entry
Live preview of the showcase page. Click to explore the full experience.
Color Palette
Primary
#18181b
Secondary
#fafafa
Accent 1
#3b82f6
Accent 2
#8b5cf6
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 linkageComponent 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
/* 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
便当盒布局 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.