# 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

Presentation Main Title

Subtitle description text

Presenter: John Smith

December 2024

Product Department

``` ### cover-photo-mask — Background Image + Mask Cover Full-screen image + dark mask + centered title. **Download image first**: `curl -L "https://source.unsplash.com/1920x1080/?keyword" -o cover-bg.jpg` ```html

Presentation Title Here

Subtitle or one-line overview

Presenter · Date

``` **Mask color rule**: Replace `rgba(26,51,64,0.75)` RGB with theme's primary-90 value. ### cover-dark-hero — Dark Background Hero Cover (No Photo Needed) > `centered | low | dark | none` — ideal fallback when Unsplash fails, strong minimalist opening. ```html
Presentation Title
Subtitle or one-line description Presenter · Date
``` --- ## TOC Components ### toc-sidebar-list — Sidebar + Numbered List Left dark sidebar (30%) + right numbered chapter list. ```html

CONTENTS

Contents

01

Chapter One Title

02

Chapter Two Title

``` ### toc-card-grid — Card Grid TOC One numbered card per chapter, 3-4 columns. ```html

Contents

01

Chapter Title

Brief description

02

Chapter Title

Brief description

``` ### toc-timeline — Horizontal Timeline TOC Horizontal nodes + connecting lines + chapter titles. For sequential content. ```html

Contents

01

Chapter Title

Brief description

02

Chapter Title

Brief description

``` ### 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

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

``` ### 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

Plan Comparison

Plan A

Plan B

``` ### content-timeline — Horizontal Process/Steps Horizontal step nodes + descriptions. 3-5 steps. ```html

Implementation Roadmap

1

Requirements Analysis

Research user needs

2

Solution Design

Implementation plan

``` ### 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

Table Title

项目

Q1

Q2

Q3

Q4

Engineering

$1.2M

$1.5M

$1.8M

$2.1M

Total

$4.0M

$6.2M

``` ### content-table-comparison — Feature Comparison Matrix > `data | medium | light | tag` — Rows = options, columns = criteria, last column = tag. Tag colors: `${accent}` bg = recommended, `${primary-10}` bg = neutral/pass. ```html

方案对比

方案

成本

实施周期

可扩展性

综合评级

方案 A

3 个月

推荐

``` --- ## 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
02 CHAPTER
Chapter Title Here One-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 METRIC 85% Description of what this metric means
+12% vs last year
#3 Industry 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
SECTION Core
Concept
Brief framing of this content area
1
Point Title One Description text supporting this point
2
Point Title Two Description text supporting this point
3
Point Title Three Description 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 One Card description text, one or two sentences.
Card Title Two Card description text, one or two sentences.
Card Title Three Card description text, one or two sentences.
``` --- ## Transition Page Components ### divider-bold-center — Centered Bold Text Transition ```html

02

Chapter Title

One-line overview

``` ### divider-split — Split Background Transition ```html

02

Chapter Title

One-line overview

``` ### divider-photo-mask — Background Image + Mask Transition ```html

02

Chapter Title

One-line overview

``` ### divider-gradient — Gradient Background Transition > Requires pre-generating gradient PNG via sharp/SVG. ```javascript const svg = ``; await sharp(Buffer.from(svg)).png().toFile('gradient-bg.png'); ``` ```html

03

Chapter Title

One-line overview

``` --- ## Closing Page Components ### closing-takeaways — Key Takeaways Summary Header bar + 3 key takeaway cards with top accent borders. ```html

Key Conclusions

01

Takeaway Point One

Brief note

02

Takeaway Point Two

Brief note

``` ### closing-thankyou — Thank You Page Dark background + large thank-you + contact info. Echoes cover. ```html

Thank You

John Smith | Product Department

john.smith@company.com

```