# Components — Pre-built HTML Component Reference Library
Each component is a **starting point, not a straitjacket**. Use them as inspiration and building blocks.
**Three ways to use this library**:
1. **Direct use**: Copy a component template, replace `${...}` variables and text content (safest, guaranteed to convert correctly)
2. **Remix**: Start from a template, then freely modify spacing, font sizes, card styles, background treatments, decorative elements, and layout proportions (encouraged — this creates variety)
3. **Free creation**: Design entirely new layouts from scratch based on html2pptx.md technical constraints (most flexible — must test conversion)
**The goal is visual diversity. If the deck looks monotonous, you haven't remixed enough.**
---
## Usage Rules
1. **Variable replacement**: All `${variableName}` must be replaced with actual values (colors, font names)
2. **Everything is modifiable**: Spacing, font sizes, padding, margins, gap, border-radius, shadows, card styles, background colors, layout proportions — change anything to serve the content and create variety
3. **Only engine constraints are sacred**: Don't use flex-wrap, negative margins, DIV background-image, or CSS gradients (see html2pptx.md Technical Constraints)
4. **Colors must come from the theme scale** — this is the one design-system rule that's enforced
5. **Adjacent slides should look distinctly different** — vary layout, background, card treatment, spacing density
6. **Fill the slide**: Content should use the available space well. Avoid large empty areas — if there's too much whitespace, add more content, use larger type, increase spacing, or add visual elements
---
## Card Style Cookbook (Quick Reference)
Every component template uses shadow-float cards by default. **Swap in these alternatives** to create variety across slides:
| Style | Name | CSS |
|-------|------|-----|
| A | Shadow Float | `background:${surface-card}; border-radius:10pt; box-shadow:0 2pt 8pt rgba(0,0,0,0.08); padding:20pt;` |
| B | Outline | `background:transparent; border:1.5pt solid ${primary-20}; border-radius:10pt; padding:20pt;` |
| C | Solid Fill | `background:${primary-10}; border-radius:10pt; padding:20pt; border:none; box-shadow:none;` |
| D | Left Accent Bar | `background:${surface-card}; border-left:4pt solid ${accent}; border-radius:0 10pt 10pt 0; padding:16pt 20pt; box-shadow:none;` |
| E | Solid Fill + Bottom Accent | `background:${surface}; border-radius:10pt; border-bottom:3pt solid ${accent}; padding:20pt; box-shadow:none;` |
| F | Dark Card | `background:${primary-90}; border-radius:10pt; padding:20pt; color:${on-dark}; box-shadow:none;` |
**Rule: No 2 adjacent slides should use the same card style.**
---
## Title Bar Variants (Quick Reference)
Components use a dark title bar by default. **Swap in these alternatives**:
| Variant | Description |
|---------|-------------|
| Default | `height:56pt; background:${primary-90}` with white bold title at `font-size:22pt` |
| Accent Color | Same structure but `background:${accent}` |
| Transparent + Underline | `padding:28pt 48pt 12pt 48pt; border-bottom:2pt solid ${primary-20};` title at `font-size:28pt; color:${primary-80}` |
| No Header Bar (Inline Title) | No separate header div; title is part of content area at `font-size:32pt; color:${primary-80}` |
| Left Vertical Band | `display:flex; height:56pt;` with `width:6pt; background:${accent}` left strip + rest is `background:${surface}` |
**Rule: All content slides must use the same title bar style — pick one variant and apply it consistently across the entire deck.**
---
## Dark Background Content Templates
Use these dark variants for **rhythm-breaking slides** (recommended every 3-4 pages).
### content-dark-bullets — Dark Background Bullet List
> `list | medium | dark | outline-light`
```html
Page Title
1
Point Title Description text
```
### content-dark-kpi — Dark Background KPI Dashboard
> `grid | low | dark | solid-dark`
```html
Dashboard Title
85% Metric Label
2.4M Metric Label
+32% Metric Label
```
### content-dark-split — Dark Background Left-Right Split
> `split | medium | dark | none`
```html
Key Insight
Sub-point One Detailed explanation
Sub-point Two Another detailed explanation
```
---
## Component Metadata Tags
Each component is tagged with metadata to help you plan slide variety:
- **Layout type**: `split` | `grid` | `list` | `focus` | `full-bleed` | `timeline` | `centered`
- **Density**: `high` | `medium` | `low`
- **Background**: `light` | `dark` | `image` | `any`
- **Default card style**: `shadow` | `outline` | `solid` | `tag` | `none` | `any`
---
## Table of Contents
### Cover
- [cover-center](#cover-center) — Centered cover `centered | low | light | none`
- [cover-split](#cover-split) — Left-right split cover `split | low | light | none`
- [cover-bottom-bar](#cover-bottom-bar) — Bottom info bar cover `centered | low | light | none`
- [cover-photo-mask](#cover-photo-mask) — Background image + mask cover `centered | low | image | none`
- [cover-dark-hero](#cover-dark-hero) — Dark hero cover, no photo needed `centered | low | dark | none`
### TOC Pages
- [toc-sidebar-list](#toc-sidebar-list) — Sidebar + numbered list `split | medium | light | none`
- [toc-card-grid](#toc-card-grid) — Card grid TOC `grid | medium | light | shadow`
- [toc-timeline](#toc-timeline) — Horizontal timeline TOC `timeline | medium | light | none`
- [toc-big-number](#toc-big-number) — Large number background TOC `list | medium | light | none`
### Content Pages
- [content-header-bullets](#content-header-bullets) — Header bar + bullet list `list | medium | light | none`
- [content-split-text-visual](#content-split-text-visual) — Text/image split (swap columns for image-left variant) `split | medium | light | none`
- [content-split-equal](#content-split-equal) — Equal 50/50 split `split | medium | light | none`
- [content-sidebar-stat](#content-sidebar-stat) — Sidebar large number + right content `split | medium | dark+light | none`
- [content-kpi-row](#content-kpi-row) — KPI large numbers in a row `grid | medium | light | shadow`
- [content-kpi-vertical](#content-kpi-vertical) — KPI numbers vertical stack `focus | medium | light | outline`
- [content-comparison](#content-comparison) — A vs B (or A vs B vs C) comparison `grid | medium | light | tag`
- [content-timeline](#content-timeline) — Horizontal process/steps `timeline | medium | light | none`
- [content-timeline-vertical](#content-timeline-vertical) — Vertical timeline `timeline | medium | light | none`
- [content-icon-grid](#content-icon-grid) — 2×3 icon grid `grid | high | light | none`
- [content-2x2-grid](#content-2x2-grid) — Four-quadrant grid (shadow) `grid | high | light | shadow`
- [content-2x2-grid-outline](#content-2x2-grid-outline) — Four-quadrant grid (outline) `grid | high | light | outline`
- [content-2x2-grid-solid](#content-2x2-grid-solid) — Four-quadrant grid (solid dark) `grid | high | dark | solid`
- [content-full-bleed](#content-full-bleed) — Full-bleed color block `full-bleed | low | dark | none`
- [content-left-accent-bar](#content-left-accent-bar) — Left accent bar emphasis `split | medium | light | none`
- [content-stagger-list](#content-stagger-list) — Staggered list `list | medium | light | none`
- [content-big-number-focus](#content-big-number-focus) — Large number focus `split | low | dark+light | none`
- [content-three-column](#content-three-column) — Three-column with icons `grid | medium | light | none`
- [content-three-card](#content-three-card) — Three card columns `grid | medium | light | shadow`
- [content-split-photo](#content-split-photo) — Left text + right photo `split | medium | light | none`
- [content-photo-cards](#content-photo-cards) — Three photo cards `grid | medium | light | shadow`
- [content-stat-overlay](#content-stat-overlay) — Hero stat on photo `full-bleed | low | image | none`
- [content-photo-overlay](#content-photo-overlay) — Full photo + floating card `full-bleed | low | image | frosted`
- [content-chart-focus](#content-chart-focus) — Chart-focused page `split | medium | light | none`
- [content-chart-bar](#content-chart-bar) — Bar chart + key metric cards `split | medium | light | none`
- [content-chart-pie](#content-chart-pie) — Pie chart + legend & insight `split | medium | light | none`
- [content-chart-line](#content-chart-line) — Wide line chart + trend stats `list | medium | light | none`
- [content-band-top](#content-band-top) — Top color band + content `list | medium | light | none`
- [content-table](#content-table) — Structured data table `data | medium | light | none`
- [content-table-comparison](#content-table-comparison) — Feature comparison matrix `data | medium | light | tag`
### High-Impact Accent Components
- [chapter-divider-bold](#chapter-divider-bold) — Accent panel + dark chapter divider `split | low | dark | none`
- [content-hero-stat](#content-hero-stat) — Single-focus large metric page `centered | low | dark | none`
- [content-asymmetric](#content-asymmetric) — Asymmetric dark panel (38%) + content (62%) `split | medium | dark+light | none`
- [quote-emphasis](#quote-emphasis) — Full-slide pull quote on dark background `centered | low | dark | none`
- [content-dark-three-card](#content-dark-three-card) — Dark background three-card rhythm breaker `grid | medium | dark | solid-dark`
### Data Visualization Pages (see [`data-viz-components.md`](data-viz-components.md))
- content-horizontal-bars — Horizontal bar comparison
- content-stacked-bars — Stacked progress bars
- content-data-table — Structured data table
- content-quadrant-matrix — 2×2 quadrant matrix
- content-funnel — Sales/conversion funnel
- content-before-after — Before vs after
- content-dashboard — Data dashboard / KPI grid
- content-pyramid — Pyramid / layered hierarchy
### Transition Pages
- [divider-bold-center](#divider-bold-center) — Centered bold transition `centered | low | light | none`
- [divider-split](#divider-split) — Split background transition `split | low | dark+light | none`
- [divider-photo-mask](#divider-photo-mask) — Background image + mask transition `centered | low | image | none`
- [divider-gradient](#divider-gradient) — Gradient background transition `centered | low | dark | none`
### Closing Pages
- [closing-takeaways](#closing-takeaways) — Key takeaways summary `grid | medium | light | tag`
- [closing-thankyou](#closing-thankyou) — Thank you page `centered | low | dark | none`
---
## Cover Components
### cover-center — Centered Cover
Centered symmetrical layout. Accent dot + title + accent line divider + subtitle.
```html
Presentation Title Here
Subtitle or one-line overview
Presenter: John Smith · December 2024
```
### cover-split — Left-Right Split Cover
Left dark block (40%) with top anchor label + bottom vertical bar. Right text with accent divider.
```html
ANNUAL REPORT 2024
Department · Category
Presentation Main Title
Subtitle description text
Presenter: John Smith · Product Department
```
### cover-bottom-bar — Bottom Info Bar Cover
Full-width centered title + bottom dark info bar.
```html
```
### toc-big-number — Large Number Background TOC
Extra-large semi-transparent numbers as background, chapter titles float on top.
```html
Contents
01
Chapter One Title
02
Chapter Two Title
```
---
## Content Page Components
### content-header-bullets — Header Bar + Bullet List
Dark header bar + bullet point list with left accent bars.
```html
Page Title
Key Point Title One
Description text for the key point
Key Point Title Two
Description text for the key point
```
### content-split-text-visual — Text / Image Split
Left text (40%) + right image/chart (60%). **For image-left layout, swap the two columns** (put the image div first at `width:360pt`, text div second at `width:240pt`).
```html
Page Title
Sub-heading
First key point
Second key point
Third key point
Source: 2024 Annual Report
```
### content-split-equal — Equal 50/50 Split
Two equal columns with a vertical divider.
```html
Page Title
Left Column Title
Left column content text.
Right Column Title
Right column content text.
```
### content-sidebar-stat — Sidebar Large Number + Right Content
Left narrow sidebar with KPIs, right side with detailed content.
```html
86%
User Satisfaction
2.4×
Efficiency Improvement
Core Business Results
User satisfaction rose from 72% to 86%
Operational efficiency improved 2.4x YoY
Client renewal rate reached 95%
New customer acquisition cost reduced by 35%
```
### content-kpi-row — KPI Large Numbers in a Row
2-4 key data indicators displayed horizontally, cards with shadow elevation.
```html
Core Business Metrics
86%
User Retention Rate
2.4×
Customer Acquisition Efficiency
Data source: 2024 Annual User Survey | Period: Jan-Dec 2024
```
### content-kpi-vertical — KPI Numbers Vertical Stack
> `focus | medium | light | outline`
Left dark sidebar title + right KPI stack with outline cards.
```html
Key Metrics
Performance highlights for 2024
92%
Customer Satisfaction
Up 12 points from prior year
3.1×
Revenue Growth
Fastest in company history
```
### content-comparison — A vs B (or A vs B vs C) Comparison
Comparison cards with top accent border. **For 2-way**: two cards at `width:296pt`. **For 3-way**: three cards at `width:192pt;flex-shrink:0` with border colors `${accent}` / `${primary-60}` / `${primary-40}`.
```html
```
### content-timeline-vertical — Vertical Timeline
> `timeline | medium | light | none` — Vertical flow with numbered nodes and connecting lines.
```html
Timeline
1
Phase One — Discovery
Research and stakeholder interviews
2
Phase Two — Design
Prototyping and iterative design
```
### content-icon-grid — 2×3 Icon Grid
Grid display of 6 features. **Two independent flex rows, no flex-wrap**. Icon positions use colored circle placeholders.
```html
Core Features
⚡
Feature Name
Brief description
📊
Feature Name
Brief description
🔒
Feature Name
Brief description
```
### content-2x2-grid — Four-Quadrant Grid (Shadow Cards)
Four equal-sized cards. **Two independent flex rows, no flex-wrap**.
```html
Four Core Pillars
Pillar One
Description content
Pillar Two
Description content
```
### content-2x2-grid-outline — Four-Quadrant Grid (Outline Cards)
> `grid | high | light | outline` — Same layout as content-2x2-grid but card style is outline.
**Diff from shadow version**: Replace card div `background:${surface}; border-radius:10pt;` with:
```
border:1.5pt solid ${primary-20}; border-radius:10pt; padding:16pt 20pt;
```
Remove any `box-shadow`. All other structure identical.
### content-2x2-grid-solid — Four-Quadrant Grid (Solid Dark Cards)
> `grid | high | dark | solid` — Dark background + solid primary-colored cards.
**Diff from shadow version**: Background is `${primary-90}`, cards use `background:${primary-80}`, text colors switch to `${on-dark}` / `${on-dark-secondary}`. Title uses `${on-dark}` with accent underline divider. No box-shadow.
### content-full-bleed — Full-Bleed Color Block Emphasis Page
Full dark background + decorative element + key insight. For visual rhythm variation.
```html
★
Core Insight or Key Quote
Supporting text to explain or expand on the core insight
```
### content-left-accent-bar — Left Accent Bar Emphasis Page
Left thick accent bar + left color block + right content with numbered points.
```html
!
Key Conclusion
Conclusion Title
1
Detailed description of the first conclusion point
2
Detailed description of the second conclusion point
```
### content-stagger-list — Staggered List
Each item has a differently colored number block. For processes, rankings, priority lists.
```html
List Title
01
Step One Title
Description text
02
Step Two Title
Description text
```
### content-big-number-focus — Large Number Focus Page
Oversized number + explanatory text. For data highlights, milestones.
```html
15 Million
Number Meaning Label
The Story Behind the Number
Detailed interpretation and background explanation
85%
Related Metric A
3.2x
Related Metric B
```
### content-three-column — Three-Column Equal-Width Content
Three columns with circular icons + vertical dividers. For "three advantages", "three phases", etc.
```html
Three-Column Title
A
Column One Title
Brief description text
```
### content-three-card — Three Card Columns
> `grid | medium | light | shadow` — Three equal shadow cards with icon boxes. Different from three-column (which has circle icons + dividers).
```html
Three Key Aspects
A
Card Title One
Descriptive text
B
Card Title Two
Descriptive text
```
### content-split-photo — Left Text + Right Photo
Left: title + text with accent bar. Right: photograph with rounded corners. **Requires downloaded image.**
```html
Page Title Here
Sub-heading Text
First paragraph explaining a key concept.
Second paragraph with additional evidence.
Third paragraph with concluding insight.
```
### content-photo-cards — Three Photo Cards
Three cards, each with photo header, title, and description. **Requires 3 downloaded images.**
```html
Page Title Here
Card Title One
Brief description
Card Title Two
Brief description
```
### content-stat-overlay — Hero Stat on Photo Background
Full-screen photo + dark mask + large centered statistic. **Requires downloaded image.**
```html
KEY METRIC
2,500+
Active Users
Brief description providing context for this statistic
```
**Mask color rule**: Replace `rgba(26,51,64,0.80)` RGB with theme's primary-90 value.
### content-photo-overlay — Full Photo + Floating Text Card
> `full-bleed | low | image | frosted` — Full-screen photo + semi-transparent floating card.
```html
Section Title
Key insight that complements the background image.
Supporting detail or data point
```
### content-chart-focus — Chart-Focused Page
> `split | medium | light | none` — Chart takes 70%, narrow text sidebar for interpretation.
```html
Data Analysis
Chart Area
Key Insight
Chart interpretation
+42%
Year-over-year growth
```
### content-chart-bar — Bar Chart + Key Metric Cards
> `split | medium | light | none` — Chart placeholder takes left ~67%, right sidebar shows 3 KPI cards. Column widths: chart 420pt + gap 20pt + sidebar 184pt = 624pt.
```html
Revenue by Quarter
Bar Chart
Q4(最高)
$2.1M
全年总计
$6.6M
同比增长
+32%
```
### content-chart-pie — Pie Chart + Legend & Insight
> `split | medium | light | none` — Square chart placeholder on left (260×260pt), legend + insight on right (332pt). Legend items use colored dot + label + percentage.
```html
Market Share Distribution
Pie Chart
Category A
42%
Category B
28%
Category C
18%
Others
12%
Key insight explaining the most important takeaway from the distribution.
```
### content-chart-line — Wide Line Chart + Trend Stats
> `list | medium | light | none` — Accent stripe header (no dark bar). Wide chart placeholder stretches to fill vertical space, 4 stat cards pinned to the bottom. Chart area: 624pt wide × ~220pt tall.
```html
Growth Trend
2021 — 2025
Line Chart
起始值
$1.2M
当前值
$6.6M
CAGR
+41%
峰值时间
Q3 2025
```
### content-band-top — Top Color Band + Content Below
> `list | medium | light | none`
```html
Page Title
Subtitle
Point One
Explanation
Point Two
Explanation
```
### content-table — Structured Data Table with Zebra Rows
> `data | medium | light | none` — **No `
` tags — rows are flex divs.** Column widths sum to 624pt.
```html
```
---
## High-Impact Accent Components
Use these for visual punch: chapter openings, key metric reveals, strong statements, and rhythm breaks.
### chapter-divider-bold — Accent Panel + Dark Chapter Divider
> `split | low | dark | none` — Full-bleed dark slide with bold chapter number. Use at the opening of each major section.
Left 40%: accent-color panel with oversized chapter number. Right 60%: dark background with chapter title and one-line overview. Produces strong structural signal between sections.
```html
02CHAPTER
Chapter Title HereOne-line description of this chapter's content
```
### content-hero-stat — Single-Focus Large Metric Page
> `centered | low | dark | none` — One dominant number, optionally with 2 supporting context metrics below. Use for single powerful KPI reveals, survey results, or market data.
```html
KEY METRIC85%Description of what this metric means
+12%vs last year
#3Industry rank
```
### content-asymmetric — Asymmetric Dark Panel + Content
> `split | medium | dark+light | none` — Left 38% dark panel with section label and framing tagline; right 62% light area with 3 numbered key points. Breaks the visual monotony of symmetric layouts.
```html
SECTIONCore ConceptBrief framing of this content area
1
Point Title OneDescription text supporting this point
2
Point Title TwoDescription text supporting this point
3
Point Title ThreeDescription text supporting this point
```
### quote-emphasis — Full-Slide Pull Quote
> `centered | low | dark | none` — Full dark slide with oversized opening quotation mark, large quote text, and attribution. Use for powerful statements, expert opinions, or memorable data points framed as quotes. **For a light-background variant**: replace `background-color:${primary-90}` with `${surface}`, `color:#FFFFFF` with `${primary-80}`, and `rgba(255,255,255,0.55)` with `${primary-40}`.
```html
"Quote text goes here — one or two lines of impactful, memorable prose.— Person Name, Title · Year
```
### content-dark-three-card — Dark Background Three-Card Rhythm Breaker
> `grid | medium | dark | solid-dark` — Same role as a regular three-card content page but on a dark background. Use every 3–4 slides to break white-page monotony. Inline title (no title bar) creates visual distinction from light-background pages.
```html
Page Title
Card Title OneCard description text, one or two sentences.
Card Title TwoCard description text, one or two sentences.
Card Title ThreeCard description text, one or two sentences.