Layout Presets - Declarative Slide Composition
Overview
Slides are composed using atomic components placed in regions defined by layout presets within a 640x360 SVG viewport.
┌──────────────────────────────────────────────────┐
│ TITLE ZONE │
│ ┌─────────────────────────────┐ ┌─────────────┐ │
│ │ Badge + Title + Subtitle │ │ CFU/Answer │ │
│ └─────────────────────────────┘ └─────────────┘ │
├──────────────────────────────────────────────────┤
│ CONTENT ZONE │
│ ┌─────────────────┐ ┌─────────────────────────┐ │
│ │ Content Box │ │ SVG Card │ │
│ │ (text/lists/ │ │ (graphs/diagrams) │ │
│ │ equations) │ │ │ │
│ └─────────────────┘ └─────────────────────────┘ │
└──────────────────────────────────────────────────┘
Atomic Components
| Component | Purpose | Implementation |
|---|---|---|
| Title Zone | Badge + Title + Subtitle | SVG <g> group with text elements |
| Content Box | Any text content | SVG <g> group with text/foreignObject |
| SVG Card | Graphs/diagrams | SVG <g> group with visual elements |
| CFU/Answer | Overlay boxes (animated) | CfuAnswerCard TSX component |
Layout Presets (Starting Points — Create Custom Layouts Too)
These presets are starting points. You may create custom layouts within the 640x360 SVG viewport.
| Preset | Content Zone Split | Use When |
|---|---|---|
full-width |
100% | Text-only slides, summaries |
two-column |
40% / 60% | Text + visual side-by-side |
graph-heavy |
35% / 65% | Narrow text + large graph |
centered |
stacked (main + support) | Equation/diagram as hero, text below |
with-cfu |
100% + overlay | Full-width + CFU question |
two-column-with-cfu |
40% / 60% + overlay | Two-column + CFU |
centered-with-cfu |
stacked + overlay | Centered content + CFU |
Column Content Rules (CRITICAL)
The 3-Second Scan Test: Can a student understand the slide's key point in 3 seconds? If not, it's too cluttered.
Left and right columns serve DIFFERENT purposes. Never duplicate content.
Left Column Purpose: TEXT CONTENT
| Allowed | NOT Allowed |
|---|---|
| Problem reminder (<=15 words) | Full problem statement |
| Step badge + title | Explanatory subtitles |
| Large main content (36-48px) | "First, let's..." prose |
| Brief bullets (3-5 words each) | Redundant info boxes |
Right Column Purpose: VISUAL REPRESENTATION
| Allowed | NOT Allowed |
|---|---|
| Diagrams, graphs, tables | Text paragraphs |
| Minimal labels (numbers, variables) | Explanatory sentences |
| Annotations (arrows, highlights) | Duplicate explanations |
| Visual representations of math | Same content as left column |
The Complementary Test
LEFT RIGHT
───────────── ─────────────
"? × 6 = 30" → [Tape diagram with 6 in each box]
"30 ÷ 6 = ?" [Visual showing 5 groups]
Text explains WHAT. Visual shows HOW IT LOOKS.
Never write the same thing in both places.
SVG Coordinate System (640x360)
All positions use SVG coordinates within the viewBox="0 0 640 360" viewport.
Layout Zones
| Zone | Y Position | Height | Purpose |
|---|---|---|---|
| Title | 0-70 | 70 | Slide title + subtitle |
| Buffer | 70-80 | 10 | Separation space |
| Content | 80-340 | 260 | Main content area |
| Buffer | 340-345 | 5 | Separation space |
| Footnote | 345-360 | 15 | Sources, page info |
Layout Presets (Default Regions)
| Preset | Left Column | Right Column |
|---|---|---|
full-width |
x=15, y=100, w=610 | — |
two-column |
x=15, y=100, w=245 | x=275, y=100, w=350 |
graph-heavy |
x=15, y=100, w=210 | x=240, y=100, w=385 |
centered |
main: x=95, y=100, w=450 | support: x=95, y=260, w=450 |
Slide Composition Flow
Step 1: Choose Layout Preset
Based on slide content needs:
- Text only →
full-width - Text + graph side-by-side →
two-columnorgraph-heavy - Equation/diagram as hero with text below →
centered - Needs CFU → add
-with-cfu
When to use centered vs two-column:
Use centered when... |
Use two-column when... |
|---|---|
| The equation IS the visual | You need text explaining + separate visual |
| A small diagram is self-explanatory | The visual needs space (coordinate graph) |
| Step is simple (1 operation) | Step has multiple parts to show |
| You want focus on ONE thing | You need to show relationship between text and visual |
Step 2: Fill Title Zone
Every slide has a title zone with badge, title, and optional subtitle, rendered as SVG <g> groups with data-element-id attributes.
Step 3: Place Content in Regions
Content is placed in SVG <g> groups within the coordinate system. Each group gets a data-element-id for progressive reveal via the show() predicate.
Step 4: Add CFU/Answer (if needed)
CFU/Answer use separate slide IDs — they appear via progressive reveal using the show() predicate, not overlays on the same slide.
CFU and Answer are rendered via the CfuAnswerCard TSX component with their own slide IDs ("step-N-cfu", "step-N-answer").
Content Composition
Within content regions, compose using SVG elements:
| Element | SVG Pattern |
|---|---|
| Prose | <text> or <foreignObject> with HTML content |
| Header | <text> with appropriate font-size |
| Bullet list | <foreignObject> with <ul><li> content |
| Numbered list | <foreignObject> with <ol><li> content |
| Equation | <text> with Georgia font, centered |
| Bold/highlight | <tspan> with fill color or <foreignObject> with styled content |
Element IDs (Required for Progressive Reveal)
Every distinct visual element group must have a data-element-id attribute on its SVG <g> wrapper. This enables:
- The
show()predicate to control visibility per slide - Fixture tests to verify
visibleElementsandhiddenElementsper slide ID - The
<Animated>wrapper to handle transitions
<g data-element-id="base-graph">
{/* Grid, axes, labels */}
</g>
<g data-element-id="line-1">
{/* Blue line + point */}
</g>
<g data-element-id="label-intercept">
{/* Y-intercept annotation */}
</g>
Naming Convention:
line-Nfor data lines and their associated pointslabel-Xfor text annotations (X = descriptive suffix like "b0", "shift20")arrow-Xfor arrows (X = descriptive suffix like "shift", "highlight")eq-Nfor equation labels (N = line number)point-Xfor point labels (X = coordinates like "3,9")
Creative Layout Ideas
Beyond the standard presets, consider these layouts when they better serve the content:
- Full-bleed visual with text overlay: Visual fills most of the slide, key text in a semi-transparent card
- Asymmetric split (30/70 or 25/75): When the visual needs significantly more space than the text
- Centered hero with supporting details below: Large visual or equation centered, brief explanation underneath
- Three-column comparison: For slides comparing multiple approaches or representations
- Grid layout: For practice problems or when showing multiple related items
- Stacked full-width sections: Title → visual → supporting text, all spanning the full width