|$ curl https://forge-ai.dev/api/markdown?path=docs/components/cards
$cat docs/cards.md
updated Recently·22 min read·published

Cards

CSSHTMLTailwindBootstrapUIIntermediate🎯Free Tools
Card Components

Cards are versatile containers for grouping related content and actions. This guide covers production-ready card patterns in plain HTML/CSS, Tailwind CSS, and Bootstrap — including basic, horizontal, feature, pricing, testimonial, stat, grid, and interactive hover cards.

info

Treat cards as self-contained units. Use a semantic <article> element when the card makes sense on its own, and keep heading levels in a logical order for screen-reader users.
Basic Card

A simple card with media area, title, description, badge, and action button. Uses subtle borders and a hover elevation effect.

basic-card
Live
untitled.html
HTML
1<article class="card">
2 <div class="card-media">
3 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
4 <rect x="3" y="3" width="18" height="18" rx="2"/>
5 <circle cx="8.5" cy="8.5" r="1.5"/>
6 <path d="M21 15l-5-5L5 21"/>
7 </svg>
8 </div>
9 <div class="card-body">
10 <span class="card-badge">
11 Featured
12 </span>
13 <h3 class="card-title">
14 Card Title
15 </h3>
16 <p class="card-desc">
17 A well-designed card groups related content and actions, making information scannable and actionable.
18 </p>
19 <button class="card-btn">
20 Learn More
21 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
22 <path d="M5 12h14M12 5l7 7-7 7"/>
23 </svg>
24 </button>
25 </div>
26</article>
preview
Horizontal Card

Side-by-side layouts are ideal for search results, lists, or summaries where the media supports the content.

horizontal-card
Live
untitled.html
HTML
1<article class="card">
2 <div class="card-media">
3 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
4 <rect x="2" y="3" width="20" height="14" rx="2"/>
5 <line x1="8" y1="21" x2="16" y2="21"/>
6 <line x1="12" y1="17" x2="12" y2="21"/>
7 </svg>
8 </div>
9 <div class="card-body">
10 <h3 class="card-title">
11 Horizontal Card
12 </h3>
13 <p class="card-desc">
14 Side-by-side layouts work great for lists, search results, or product summaries where the image supports the content.
15 </p>
16 <a href="#" class="card-link">
17 Read case study
18 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
19 <path d="M5 12h14M12 5l7 7-7 7"/>
20 </svg>
21 </a>
22 </div>
23</article>
preview
Feature Card

A compact feature card with a glowing gradient accent, an inline SVG icon, and a clear value proposition.

feature-card
Live
untitled.html
HTML
1<article class="card">
2 <div class="card-glow">
3 </div>
4 <div class="card-icon">
5 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
6 <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
7 </svg>
8 </div>
9 <h3 class="card-title">
10 Instant Previews
11 </h3>
12 <p class="card-desc">
13 See component changes in real time with a live iframe preview, syntax highlighting, and framework tabs.
14 </p>
15</article>
preview
Pricing Card

A conversion-focused pricing card with a highlighted tier, feature list, and primary call-to-action.

pricing-card
Live
untitled.html
HTML
1<article class="card highlight">
2 <div class="plan-name">
3 Pro Plan
4 </div>
5 <div class="plan-price">
6 $29
7 <span>
8 /mo
9 </span>
10 </div>
11 <ul class="features">
12 <li>
13 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
14 <polyline points="20 6 9 17 4 12"/>
15 </svg>
16 Unlimited projects
17 </li>
18 <li>
19 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
20 <polyline points="20 6 9 17 4 12"/>
21 </svg>
22 Team collaboration
23 </li>
24 <li>
25 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
26 <polyline points="20 6 9 17 4 12"/>
27 </svg>
28 Priority support
29 </li>
30 <li>
31 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
32 <polyline points="20 6 9 17 4 12"/>
33 </svg>
34 Custom domains
35 </li>
36 </ul>
37 <button class="plan-btn">
38 Get Started
39 </button>
40</article>
preview
Testimonial Card

A quote card with an avatar, author details, and a subtle border — perfect for social proof sections.

testimonial-card
Live
untitled.html
HTML
1<article class="card">
2 <p class="quote">
3 <svg viewBox="0 0 24 24" fill="currentColor">
4 <path d="M14.017 21L14.017 18C14.017 16.8954 14.9124 16 16.017 16H19.017C19.5693 16 20.017 15.5523 20.017 15V9C20.017 8.44772 19.5693 8 19.017 8H15.017C14.4647 8 14.017 8.44772 14.017 9V11C14.017 11.5523 13.5693 12 13.017 12H12.017V5H22.017V15C22.017 18.3137 19.3307 21 16.017 21H14.017ZM5.0166 21L5.0166 18C5.0166 16.8954 5.91203 16 7.0166 16H10.0166C10.5689 16 11.0166 15.5523 11.0166 15V9C11.0166 8.44772 10.5689 8 10.0166 8H6.0166C5.46432 8 5.0166 8.44772 5.0166 9V11C5.0166 11.5523 4.56889 12 4.0166 12H3.0166V5H13.0166V15C13.0166 18.3137 10.3303 21 7.0166 21H5.0166Z"/>
5 </svg>
6 ForgeLearn cut our onboarding time in half. The component patterns are battle-tested and the dark UI fits our brand perfectly.
7 </p>
8 <div class="author">
9 <div class="avatar">
10 JD
11 </div>
12 <div class="author-info">
13 <span class="author-name">
14 Jane Doe
15 </span>
16 <span class="author-role">
17 Engineering Lead
18 </span>
19 </div>
20 </div>
21</article>
preview
Stat Card

A metric card for dashboards: label, large value, trend indicator, and comparison text.

stat-card
Live
untitled.html
HTML
1<article class="card">
2 <div class="stat-label">
3 Total Builds
4 </div>
5 <div class="stat-value">
6 12.5k
7 </div>
8 <span class="stat-change">
9 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
10 <path d="M23 6l-9.5 9.5-5-5L1 18"/>
11 <path d="M17 6h6v6"/>
12 </svg>
13 +18%
14 </span>
15 <div class="stat-meta">
16 vs last month
17 </div>
18</article>
preview
Card Grid

A responsive grid of icon cards using CSS Grid. The layout adapts from one column on mobile to three columns on desktop.

card-grid
Live
untitled.html
HTML
1<div class="grid">
2 <article class="card">
3 <div class="card-icon">
4 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
5 <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>
6 </svg>
7 </div>
8 <h3 class="card-title">
9 Fast
10 </h3>
11 <p class="card-desc">
12 Optimized for speed with minimal overhead.
13 </p>
14 </article>
15 <article class="card">
16 <div class="card-icon">
17 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
18 <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
19 <path d="M7 11V7a5 5 0 0 1 10 0v4"/>
20 </svg>
21 </div>
22 <h3 class="card-title">
23 Secure
24 </h3>
25 <p class="card-desc">
26 Built-in security best practices.
27 </p>
28 </article>
29 <article class="card">
30 <div class="card-icon">
31 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
32 <circle cx="12" cy="12" r="3"/>
33 <path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>
34 </svg>
35 </div>
36 <h3 class="card-title">
37 Customizable
38 </h3>
39 <p class="card-desc">
40 Fully themeable with CSS variables.
41 </p>
42 </article>
43 <article class="card">
44 <div class="card-icon">
45 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
46 <rect x="4" y="2" width="16" height="20" rx="2" ry="2"/>
47 <line x1="12" y1="18" x2="12.01" y2="18"/>
48 </svg>
49 </div>
50 <h3 class="card-title">
51 Responsive
52 </h3>
53 <p class="card-desc">
54 Works on every screen size.
55 </p>
56 </article>
57 <article class="card">
58 <div class="card-icon">
59 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
60 <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
61 </svg>
62 </div>
63 <h3 class="card-title">
64 Accessible
65 </h3>
66 <p class="card-desc">
67 WCAG 2.1 compliant by default.
68 </p>
69 </article>
70 <article class="card">
71 <div class="card-icon">
72 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
73 <circle cx="12" cy="12" r="10"/>
74 <line x1="2" y1="12" x2="22" y2="12"/>
75 <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
76 </svg>
77 </div>
78 <h3 class="card-title">
79 Global
80 </h3>
81 <p class="card-desc">
82 i18n ready with RTL support.
83 </p>
84 </article>
85</div>
preview
Interactive Hover Card

A project-style card with a gradient media area and a hover-reveal action button. Uses CSS transforms and transitions for the reveal effect.

interactive-card
Live
untitled.html
HTML
1<article class="card">
2 <div class="card-img-wrap">
3 <div class="card-img">
4 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
5 <path d="M12 2L2 7l10 5 10-5-10-5z"/>
6 <path d="M2 17l10 5 10-5"/>
7 <path d="M2 12l10 5 10-5"/>
8 </svg>
9 </div>
10 <div class="card-overlay">
11 </div>
12 <button class="card-action">
13 View Project
14 </button>
15 </div>
16 <div class="card-body">
17 <h3 class="card-title">
18 Project Alpha
19 </h3>
20 <p class="card-sub">
21 Interactive hover reveal card
22 </p>
23 </div>
24</article>
preview
Accessibility

Cards must remain readable and operable for keyboard and screen-reader users. Treat each card as a content region and ensure interactive targets are easy to reach.

  • Use <article> for self-contained cards so screen readers can navigate by landmark or region.
  • Keep heading levels logical: do not skip from <h2> to <h4> inside a card.
  • Images need meaningful alt text, or aria-hidden="true" when purely decorative.
  • Make the whole card clickable with an <a> or <button> wrapper, or keep the action control focusable.
  • Ensure focus indicators are visible against the dark background.
  • Do not rely on color alone to convey status; pair badges and trend arrows with labels.
Motion & Micro-interactions

Modern cards feel tactile because of layered motion: a slight lift on hover, a green glow shadow, a subtle scale on the media, and a short upward slide on the content. Keep transitions under 350ms and animate only transform and opacity so the browser can composite them on the GPU.

📝

note

Always respect prefers-reduced-motion. When a user has requested reduced motion, disable lifts, scales, and glow pulses so the card stays static and comfortable to read.
card-motion
Live
untitled.html
HTML
1<article class="m-card" data-card>
2 <div class="m-card-media">
3 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
4 <path d="M12 2L2 7l10 5 10-5-10-5z"/>
5 <path d="M2 17l10 5 10-5"/>
6 <path d="M2 12l10 5 10-5"/>
7 </svg>
8 <span class="m-card-badge">
9 Featured
10 </span>
11 </div>
12 <div class="m-card-body">
13 <h3 class="m-card-title">
14 Motion Card
15 </h3>
16 <p class="m-card-desc">
17 Hover to see lift, glow, image scale, and content slide.
18 </p>
19 </div>
20 <div class="m-card-spotlight" data-spotlight>
21 </div>
22</article>
preview

Community

Get help on Slack, Discord or VIP

Stuck on a guide? Join the community and ask.