HomeStylesTemplates
StyleKit
StylesTemplates
  1. Home
  2. /Styles
  3. /Card Stack
Style Catalog/Card Stack

Card Stack

卡片堆叠布局

B
86/100Good

3D layout with overlapping cards, creating depth through Z-axis stacking and offsets. Ideal for carousels, step-by-step displays, and card deck selection.

card stackstacked cardscard deck3D cardscard carouselswipeable cardsz-axis layeringoverlapping cardsdepth effectonboarding cards
View Full Showcase →Templates

Best For

card stack / stacked cards / card deck

Primary Move

Use transform and z-index to create stacking effects

Watch Out

Do not stack too many cards causing clutter

Showcase Entry

Live preview of the showcase page. Click to explore the full experience.

View Full Showcase →

Color Palette

Primary

#1a1a2e

Secondary

#f0f0f5

Accent 1

#6c5ce7

Accent 2

#00cec9

Accent 3

#fd79a8

Accent 4

#ffeaa7

AI ImplementationComponent PreviewReadinessFAQExportsRatings & Feedback

AI Implementation

Copy the Hard Prompt first, then use the spec when needed

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.

Hard Prompt

Use this by default: copy it, append the concrete requirement, and let AI generate consistent production UI.

When to use

  • -When AI should generate UI directly
  • -When repeated outputs must stay consistent
  • -When style drift is the main risk

How to use

  • -Copy the full prompt
  • -Append the concrete requirement
  • -Review against forbidden rules and UI states
STYLEKIT_STYLE_REFERENCE
style_name: Card Stack
style_slug: card-stack
style_source: /styles/card-stack

# 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 frontend expert specializing in Card Stack layout. All generated code must strictly follow these constraints:

## Absolute Prohibitions

- Do NOT stack too many visible cards (max 3-5)
- Do NOT overlap cards completely (need visual distinction)
- Do NOT forget interaction feedback
- Do NOT use overly complex animations
- Do NOT use complex gestures on mobile
- Do NOT leave back cards static during hover (kills depth illusion)

## Must Follow

- Use transform for positioning: scale, translateY, rotate
- Use z-index for layering: z-30, z-20, z-10
- Progressive opacity: 100%, 80%, 60%
- Smooth transitions: transition-all duration-[400ms] ease-out
- Clear hover/active states
- Limit visible cards: 3-5 maximum

## Animation & Interaction Rules

- Deck Shuffling: On group-hover, back cards fan out sideways with different rotate + translate-x values, like shuffling a deck of cards.
- 3D Peeling: Top card on hover should significantly lift (group-hover:-translate-y-6 group-hover:scale-105 group-hover:shadow-2xl), simulating physical card being raised.
- Smooth Return: Use ease-out so cards snap back naturally from fast to slow.
- Stack Peek: Slightly change back card opacity on hover to hint their presence.

## Stack Structure

Container:
- relative position with group class for sibling interactions
- flex center alignment
- Fixed height for consistent layout

Cards (front to back):
- Card 1 (front): z-30, scale-100, opacity-100
- Card 2 (mid): z-20, scale-95, translateY-4, rotate-2, opacity-80
- Card 3 (back): z-10, scale-90, translateY-8, rotate(-3), opacity-60

On group-hover:
- Card 1: -translate-y-6, scale-105, shadow-2xl
- Card 2: rotate-6, translate-x-(-5), translate-y-8
- Card 3: -rotate-6, translate-x-5, translate-y-14

## Self-Check

After generating code, verify:
1. Cards are visually layered with different scale + opacity
2. group-hover fans back cards out to the sides
3. Front card lifts dramatically on hover
4. Max 3-5 visible cards
5. Mobile-friendly touch targets

## Absolute Bans (Match and Refuse)

If any of the following patterns appear, it is a style violation — rewrite without exception.

- stack too many cards causing clutter
- completely overlap cards hiding layer distinction
- ignore interaction feedback
- use overly complex animations affecting performance
- use overly complex gestures on mobile
- leave back cards static on hover (lacks depth perception)

## 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 stack too many cards causing clutter
- [ ] do not completely overlap cards hiding layer distinction
- [ ] do not ignore interaction feedback
- [ ] do not use overly complex animations affecting performance
- [ ] do not use overly complex gestures on mobile

Component Templates

Component Preview

切换按钮

用于切换卡片的导航按钮,hover 时上浮

Frontend Readiness

Dark Mode, States, Motion, and Accessibility

This layer tracks whether the style is ready for real websites: theme modes, state feedback, keyboard access, and performance constraints.

Overall

51%

Fallback

Dark Mode

0%

Missing

UI States

79%

Partial

Motion

70%

Partial

A11y

70%

Partial

Performance

35%

Fallback

Key State Coverage

light
HoverFocus VisibleDisabledLoadingEmptyErrorSuccess

Button

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

Implementation Notes

  • No curated dark-mode contract exists yet.
  • Check contrast in both light and dark modes.
  • Check heavy shadows, blur, large media, and scroll-linked effects manually.
  • No style-specific performance cost profile has been curated yet.

FAQ

Card Stack — Frequently Asked Questions

01What is the Card Stack design style?
3D layout with overlapping cards, creating depth through Z-axis stacking and offsets. Ideal for carousels, step-by-step displays, and card deck selection. Its core principle: Card Stack is a layout approach that creates depth perception using the Z-axis, with multiple cards overlapping front to back to form visual layers.
02What colors does Card Stack use?
Card Stack uses #1a1a2e as its primary color and #f0f0f5 as its secondary color, with accent colors #6c5ce7, #00cec9, #fd79a8, #ffeaa7. Every hex value can be copied from the palette on this page.
03How do I apply Card Stack correctly?
Key practices: Use transform and z-index to create stacking effects. Back cards scale down and offset scale-95 translate-y-4. Add progressive opacity opacity-80, opacity-60.
04What are common mistakes with Card Stack?
Avoid: Do not stack too many cards causing clutter. Do not completely overlap cards hiding layer distinction. Do not ignore interaction feedback.
05How do I prompt AI to generate Card Stack UI?
Copy the ready-made AI prompt on this page — it bundles the design tokens and component rules — and paste it into ChatGPT, Claude, Cursor, or v0. Effective prompts include the keywords: card stack, stacked cards, card deck, 3D cards.
Global Styles

Global CSS

css
/* Card Stack Global Styles */

/* Stack container */
.card-stack {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

/* Base card in stack */
.card-stack-item {
  position: absolute;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stack positions */
.card-stack-item:nth-child(1) {
  z-index: 30;
  transform: translateY(0) scale(1);
  opacity: 1;
}

.card-stack-item:nth-child(2) {
  z-index: 20;
  transform: translateY(16px) scale(0.95) rotate(2deg);
  opacity: 0.8;
}

.card-stack-item:nth-child(3) {
  z-index: 10;
  transform: translateY(32px) scale(0.9) rotate(-3deg);
  opacity: 0.6;
}

.card-stack-item:nth-child(n+4) {
  z-index: 0;
  transform: translateY(48px) scale(0.85);
  opacity: 0;
  pointer-events: none;
}

/* Fan out on hover — deck shuffle effect */
.card-stack:hover .card-stack-item:nth-child(1) {
  transform: translateY(-24px) scale(1.05);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.card-stack:hover .card-stack-item:nth-child(2) {
  transform: translateY(32px) scale(0.95) rotate(6deg) translateX(-20px);
  opacity: 0.9;
}

.card-stack:hover .card-stack-item:nth-child(3) {
  transform: translateY(48px) scale(0.9) rotate(-6deg) translateX(20px);
  opacity: 0.8;
}

/* Tinder-style swipe */
.card-stack-swipe .card-stack-item.swiping-left {
  transform: translateX(-100%) rotate(-10deg);
  opacity: 0;
}

.card-stack-swipe .card-stack-item.swiping-right {
  transform: translateX(100%) rotate(10deg);
  opacity: 0;
}
/* Card Stack Design Tokens */
:root {
  --card-stack-primary: #1a1a2e;
  --card-stack-secondary: #f0f0f5;
  --card-stack-accent: #6c5ce7;
  --card-stack-glow: rgba(26, 26, 46, 0.3);
}

@keyframes card-stack-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-stack-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.card-stack-card {
  position: relative;
  overflow: hidden;
}

.card-stack-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.05), transparent);
  pointer-events: none;
}

.card-stack-card:hover::before {
  opacity: 1;
}

.card-stack-gradient {
  background: linear-gradient(135deg, #1a1a2e, #6c5ce7);
}

.card-stack-gradient-text {
  background: linear-gradient(135deg, #1a1a2e, #6c5ce7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-stack-frosted {
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  background: rgba(26, 26, 46, 0.08);
}

.card-stack-accent-corner {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), calc(100% - 2rem) 100%, 0 100%);
}

.card-stack-animate-in {
  animation: card-stack-fade-in 0.5s ease-out both;
}

Compatible Visual Styles

Try Pairing

Card Stack is a layout pattern that can be paired with the following visual styles.

Glassmorphism

玻璃拟态

Neumorphism

新拟物派

Soft UI

柔和界面风

Modern Gradient

现代渐变风

Neo-Brutalist

新野兽派

IDE Integration

IDE Configuration Export

Download configuration files for AI coding assistants to generate code in this style.

Style Pack

Export 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

Design Philosophy

Card Stack is a layout approach that creates depth perception using the Z-axis, with multiple cards overlapping front to back to form visual layers.

Accessibility

Accessibility Score

WCAG 2.1 compliance analysis based on color contrast and typography readability.

86

Overall Score

Grade: B - Good

Contrast Ratios

Score: 86/100Average Ratio: 11.68:1
AA FailAAA Fail
ContextColorsRatioAAAAA
Text on secondary background
/#18181b / #ffffff
17.72:1
Button primary
/#ffffff / #18181b
17.72:1
Text on accent 1
/#18181b / #6c5ce7
3.65:1
Text on accent 2
/#18181b / #00cec9
9:1
Text on accent 3
/#18181b / #fd79a8
7.15:1
Text on accent 4
/#18181b / #ffeaa7
14.83:1

Readability

Score

85/100

Font Size

text-sm md:text-base

Font Weight

font-bold tracking-tight

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

Recommended Combinations with Card Stack

These curated recipes combine this style with layouts and animations, optimized for specific use cases.

Vaporwave Aesthetic

90s internet nostalgia for creative projects.

vaporwavecard-stack+3
retrocreativebold

StyleKit

A curated web design style library to help AI generate better-looking websites.

FeedbackSupport Maintenance
Explore+
StylesTemplatesAnimationsResource LibraryPromptsCollections
Learn+
FoundationsGuideRecipesChangelogBlog
Trust+
AboutContactPrivacyTermsSupport UsRefunds

(c) 2026 StyleKit. Open source project.

闄旾CP澶?025065501鍙?3

Colophon/SK — 2026

Built with the Editorial style

01FeedbackTell us what could work better02Support MaintenanceIf StyleKit helps your workflow, voluntary support helps cover servers, domains, and ongoing upkeep.

StyleKit

A curated web design style library to help AI generate better-looking websites.

GitHub Repository

Explore

StylesTemplatesAnimationsResource LibraryPromptsCollections

Learn

FoundationsGuideRecipesChangelogBlog

Dispatch

Get notified when new styles, templates and tools ship.

Stay Updated

By subscribing, you agree to our Privacy Policy and Terms.

(c) 2026 StyleKit. Open source project.

AboutContactPrivacyTermsSupport UsRefunds/陕ICP备2025065501号-3

StyleKit