Card Stack
卡片堆叠布局
stylekitMITDashboard · dashboardExperimental · experimentalLight · lightMedium · mediumBlue · blueMedium · mediumSerif · serifGeneral · general
卡片前后重叠的立体布局,通过 Z 轴层叠和偏移创造深度感,适合轮播、步骤展示、卡组选择。
NNorthwind
Product · PricingSpecimen
Make the work feel finished
One interface, dressed in this style. Compare type, color, radius, and density.
128
Active
4.8
Score
12ms
Edge
Attribution
"Card Stack" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/card-stack @ bfa7da909e86.
https://github.com/AnxForever/stylekit · api/styles/card-stack · bfa7da909e86 · © AnxForever
Do
- 使用 transform 和 z-index 创建层叠效果
- 后方卡片缩小和偏移 scale-95 translate-y-4
- 添加渐进的透明度 opacity-80, opacity-60
- 支持拖拽或点击切换卡片
- 添加流畅的过渡动画 transition-all duration-[400ms]
- 限制可见卡片数量(通常 3-5 张)
- 提供视觉提示说明可以交互
- group-hover 时底层卡片向两侧散开(不同 rotate 和 translate-x)
Don't
- 禁止堆叠过多卡片导致混乱
- 禁止卡片完全重叠看不出层次
- 禁止忽略交互反馈
- 禁止动画过于复杂影响性能
- 禁止在移动端使用过于复杂的手势
- 禁止底层卡片在 hover 时静止不动(缺乏景深感)
Prompt
Create pricing cards with stack layout: 1. 3 cards stacked: Starter, Pro, Enterprise 2. Front card fully visible with details 3. Back cards scaled down, offset, and slightly rotated 4. On group-hover: back cards fan out sideways with different rotations 5. Front card lifts with scale-105 and large shadow on hover 6. Each card: plan name, price, features list, CTA 7. Navigation arrows on sides with hover feedback Dark gradient background, white cards --- "Card Stack" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/card-stack @ bfa7da909e86. powered by Styledex — https://styledex.dev
Tokens
DTCG
{
"$schema": "https://www.designtokens.org/schemas/2025.10/format.json",
"$description": "Card Stack. \"Card Stack\" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/card-stack @ bfa7da909e86.",
"$extensions": {
"dev.styledex": {
"id": "stylekit-card-stack",
"license": "MIT",
"attribution": "\"Card Stack\" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/card-stack @ bfa7da909e86.",
"banner": "powered by Styledex — https://styledex.dev"
}
},
"color": {
"background": {
"$type": "color",
"$value": "#0f172a"
},
"foreground": {
"$type": "color",
"$value": "#18181b"
},
"card": {
"$type": "color",
"$value": "#0f172a"
},
"card-foreground": {
"$type": "color",
"$value": "#18181b"
},
"primary": {
"$type": "color",
"$value": "#1a1a2e"
},
"primary-foreground": {
"$type": "color",
"$value": "#fafaf9"
},
"secondary": {
"$type": "color",
"$value": "#f0f0f5"
},
"secondary-foreground": {
"$type": "color",
"$value": "#18181b"
},
"accent": {
"$type": "color",
"$value": "#6c5ce7"
},
"accent-foreground": {
"$type": "color",
"$value": "#fafaf9"
},
"muted": {
"$type": "color",
"$value": "#0e1627"
},
"muted-foreground": {
"$type": "color",
"$value": "#101012"
},
"border": {
"$type": "color",
"$value": "#0d1424"
},
"destructive": {
"$type": "color",
"$value": "#dc2626"
},
"ring": {
"$type": "color",
"$value": "#1a1a2e"
}
},
"font": {
"sans": {
"$type": "fontFamily",
"$value": [
"ui-sans-serif",
"system-ui",
"sans-serif"
]
},
"serif": {
"$type": "fontFamily",
"$value": [
"ui-serif",
"Georgia",
"serif"
]
},
"mono": {
"$type": "fontFamily",
"$value": [
"ui-monospace",
"SFMono-Regular",
"Menlo",
"monospace"
]
}
},
"radius": {
"base": {
"$type": "dimension",
"$value": "0.5rem"
}
},
"spacing": {
"base": {
"$type": "dimension",
"$value": "1rem"
}
},
"shadow": {
"base": {
"$type": "shadow",
"$value": "0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04)"
}
}
}
CSS
/* powered by Styledex — https://styledex.dev */
/* "Card Stack" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/card-stack @ bfa7da909e86. */
:root {
--background: #0f172a;
--foreground: #18181b;
--card: #0f172a;
--card-foreground: #18181b;
--primary: #1a1a2e;
--primary-foreground: #fafaf9;
--secondary: #f0f0f5;
--secondary-foreground: #18181b;
--accent: #6c5ce7;
--accent-foreground: #fafaf9;
--muted: #0e1627;
--muted-foreground: #101012;
--border: #0d1424;
--destructive: #dc2626;
--ring: #1a1a2e;
--radius: 0.5rem;
--font-sans: ui-sans-serif, system-ui, sans-serif;
--font-serif: ui-serif, Georgia, serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
--spacing: 1rem;
--shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}
Tailwind
/* powered by Styledex — https://styledex.dev */
/* "Card Stack" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/card-stack @ bfa7da909e86. */
/** Tailwind theme extend for Card Stack (stylekit-card-stack) */
module.exports = {
"theme": {
"extend": {
"colors": {
"background": "#0f172a",
"foreground": "#18181b",
"card": "#0f172a",
"primary": "#1a1a2e",
"primary-foreground": "#fafaf9",
"secondary": "#f0f0f5",
"accent": "#6c5ce7",
"muted": "#0e1627",
"border": "#0d1424",
"destructive": "#dc2626",
"ring": "#1a1a2e"
},
"borderRadius": {
"lg": "0.5rem"
},
"fontFamily": {
"sans": [
"ui-sans-serif",
"system-ui",
"sans-serif"
],
"serif": [
"ui-serif",
"Georgia",
"serif"
],
"mono": [
"ui-monospace",
"SFMono-Regular",
"Menlo",
"monospace"
]
},
"boxShadow": {
"styledex": "0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04)"
}
}
}
};
shadcn
/* powered by Styledex — https://styledex.dev */
/* "Card Stack" from https://github.com/AnxForever/stylekit (MIT). © AnxForever. api/styles/card-stack @ bfa7da909e86. */
@layer base {
:root {
--background: #0f172a;
--foreground: #18181b;
--card: #0f172a;
--card-foreground: #18181b;
--primary: #1a1a2e;
--primary-foreground: #fafaf9;
--secondary: #f0f0f5;
--secondary-foreground: #18181b;
--accent: #6c5ce7;
--accent-foreground: #fafaf9;
--muted: #0e1627;
--muted-foreground: #101012;
--border: #0d1424;
--destructive: #dc2626;
--ring: #1a1a2e;
--radius: 0.5rem;
--font-sans: ui-sans-serif, system-ui, sans-serif;
--font-serif: ui-serif, Georgia, serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
--spacing: 1rem;
--shadow: 0 1px 2px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}
}