Generate professional PowerPoint (.pptx) presentations using JSX/TSX with Deno. Supports slides, text, shapes, tables, charts (bar, line, pie, donut), images, gradients, shadows, and flexible layouts. Use when a user asks to create presentations, slide decks, pitch decks, reports, or any PPTX file.
Generate professional .pptx files using TypeScript JSX via @pixel/pptx.
Workflow
1. Write a .tsx file that exports a deck variable
Run the generator to produce the INLINECODE4
Usage
CODEBLOCK0
- First arg: path to your .tsx slide file (must export const deck = ...)
Second arg: output .pptx filename
INLINECODE8 — structured JSON output for agent consumption
Design Principles
These rules are distilled from the three masters of presentation design:
- Edward Tufte (Yale professor, The Visual Display of Quantitative Information) — maximize data-ink ratio, remove chartjunk, every pixel must earn its place
Nancy Duarte (designed Al Gore's An Inconvenient Truth, author of Slide:ology) — one idea per slide, visual contrast creates meaning, the audience is the hero
Garr Reynolds (author of Presentation Zen) — restraint, whitespace, signal over noise, simplicity is the ultimate sophistication
Follow these rules for every deck:
1. One idea per slide (Duarte). If you need a second point, make a second slide.
Font ≥ 24pt body, ≥ 32pt titles. If the audience can't read it from the back row, it's too small.
Max 3 colors (Reynolds). One primary, one accent, one neutral. Derive the rest as tints/shades.
Whitespace is design (Reynolds). Generous padding (≥ 0.5in slide margins, ≥ 0.2in element padding). Never fill every inch.
Contrast over decoration (Duarte). No drop shadows unless essential. No gradients for ornament. Use contrast (size, weight, color) to create hierarchy.
Data-ink ratio (Tufte). Every pixel should convey information. Remove gridlines, borders, and labels that don't add meaning.
Visual hierarchy. Title → Key number/chart → Supporting text. The eye should know where to go instantly.
Consistent rhythm. Same gaps, same padding, same font sizes across all slides. Use layout defaults on <Presentation>.
16:9 widescreen. Always set slideWidth={u.in(13.33)} slideHeight={u.in(7.5)} on <Presentation>. The library defaults to 4:3 which looks wrong on modern screens.
Preventing Text Overflow (critical)
The library uses fixed-size containers. Text that exceeds the container will overflow and be clipped. Follow these rules strictly:
1. Use grow instead of fixed h whenever possible. Inside <Row> or <Column>, prefer grow={1} over explicit h={u.in(X)}. The layout engine will calculate the correct size.
Budget height for text. Each line of 14pt text needs ~0.3in. A card with title + 4 bullet points needs at minimum: 0.3 (title) + 4×0.3 (bullets) + 0.6 (padding) = 1.8in. Always round up.
Fewer words, never more containers. If text doesn't fit, shorten the text — don't shrink the font or the container.
Max 5 bullet points per card. If you need more, split into two cards or two slides.
Test the math. For <Align> with explicit h: count lines × 0.3in + padding × 2. If the result > h, increase h or cut text.
Leave 20% headroom. If you calculate 2.0in needed, set h to at least 2.4in.
Never nest <Align> with tight heights inside <Stack>. Use <Column> with grow instead — it flexes to fit content.
Safe card pattern:
CODEBLOCK1
Table Overflow Prevention (critical)
Tables are the most common source of overflow. Follow these rules:
1. Column widths must sum to ≤ content width. For 16:9 slide with 1in padding each side: content width = 11.33in. All cols values must sum to ≤ 11.33in.
CODEBLOCK2
2. Give tables grow weight in <Column>.<Column> distributes height equally by default. A table with 5 rows needs more space than a title. Use grow to allocate proportionally:
CODEBLOCK3
3. Budget row height. Each row of 12pt text needs ~0.45in (text + padding). Header row: 0.45in. A 5-row table needs: 0.45 + 4×0.45 = 2.25in minimum.
4. Keep cell text short. Max ~40 chars per cell. If text wraps to 2 lines, the row needs 0.65in instead of 0.45in.
5. Prefer fewer rows. Max 5-6 data rows per slide. If you need more, split into two slides.
The library has no built-in page numbers. Use <Positioned> on every slide:
CODEBLOCK4
Rules:
- Always add page numbers. They help the audience track progress and reference slides.
<Positioned> is relative to content area, NOT the slide origin. Calculate: slideWidth - leftPadding - rightPadding = contentWidth. Position within those bounds.
Use the main text color (not muted) — at 12pt it must be readable.
Place <PageNum> as the last child of <Slide> — PPTX has no z-index, rendering order = declaration order. Last element renders on top, so page numbers are never occluded by other content.
Writing Slides
Create a .tsx file. It must export a deck variable:
CODEBLOCK5
Components
Layout
Component
Purpose
INLINECODE59
Root container. Props: title, INLINECODE61
INLINECODE62
Single slide. Props: background, layout |
| <Row> | Horizontal flex layout. Has <Row.Start>, <Row.End> |
| <Column> | Vertical flex layout. Has <Column.Start>, <Column.End> |
| <Stack> | Overlapping layers |
| <Align x y w h> | Center/align a single child |
| <Positioned x y w h> | Absolute positioning |
Content
Component
Purpose
INLINECODE74
Multi-paragraph text body. Props: gap, INLINECODE76
INLINECODE77
Single paragraph |
| <Text.Span> | Inline text run |
| <Text.Bold>, <Text.Italic>, <Text.Underline> | Inline formatting |
| <Text.Link href="..."> | Hyperlink |
| <Shape preset="..."> | Shape: rect, roundRect, ellipse, etc. |
| <Image src={bytes} w={...} h={...} /> | Embed image (Uint8Array) |
| <Table cols=[...]> | Table with <Table.Row> and <Table.Cell> |
Initial release of corespeed-slide — generate professional PowerPoint files with Deno using JSX/TSX:
- Create .pptx presentations supporting text, shapes, tables, charts, images, gradients, shadows, and flexible layouts.
- Follows best practices from Tufte, Duarte, and Reynolds for effective slide design.
- Includes detailed guidance to prevent text and table overflow with practical patterns and math.
- Supports custom color palettes and page numbering via explicit components.
- Requires Deno (installation instructions provided).