Complete reference for the Cuppa Studio .cup format — element types, layouts, and animation system.
Cuppa Studio supports 17 element types, each rendered differently by the player:
Standard text content. Roles determine visual styling:
| Role | Markdown | Description |
|---|---|---|
title | # Heading | Large title text |
subtitle | ### Subheading | Subtitle under title |
heading | ## Heading | Section heading |
body | Paragraph text | Body text |
caption | > Blockquote | Caption / quote text |
Syntax-highlighted code blocks using Shiki. Each theme has a matching code theme for consistent styling.
```typescript
function hello(name: string) {
return `Hello, ${name}!`;
}
``` Add a filename to show a header bar above the code block:
```typescript [src/api/handler.ts]
export function handle(req: Request) {
return new Response("OK");
}
``` Add line highlights for code stepping:
```typescript {1-3,5}
const server = createServer();
server.listen(8080);
console.log("Ready");
server.on("request", handle);
``` Highlighted lines create pause markers — click to step through code groups.
Bullet or numbered lists with animated reveal:
- First item
- Second item
- Third item
1. Ordered item one
2. Ordered item two Inside scene templates, lists render as designed card rows with multi-color accents. Use the two-line pattern for richer items:
- **Feature Name** — Description of what it does
- **Another Feature** — More details here Standard markdown tables with alignment:
| Feature | Status |
| :--- | :---: |
| Markdown | Done |
| AI | Done | Tables with 3 or more columns get styled headers with per-column accent colors automatically.
Highlight specific rows with a comment directive (1-based row indices):
<!-- highlight: 2,4 -->
| Service | Latency | Status |
| :--- | :---: | :---: |
| API | 12ms | OK |
| Auth | 340ms | Slow |
| DB | 8ms | OK |
| Cache | 280ms | Slow | Images from local paths or URLs:
 Command-line simulations with command/output distinction:
```terminal
$ npm install mycuppa
added 0 dependencies
$ mycuppa build slides.md
Built 5 scenes → slides.cup
``` Set a custom prompt with the prompt: directive on the first line:
```terminal
prompt: root@server:~#
root@server:~# systemctl status nginx
Active: running (since Mon)
``` Add colored output using inline color tags:
```terminal
$ mycuppa validate slides.cup
[green]✓ manifest valid[/green]
[green]✓ 8 scenes parsed[/green]
[red]✗ missing image: hero.png[/red]
[yellow]⚠ scene 3 has no title[/yellow]
``` Available colors: [green], [red], [yellow], [cyan], [dim].
Card grid layout for features or highlights. Each card supports an optional accent color:
```cards
- title: Fast
icon: zap
desc: Sub-100ms builds
accent: "#38bdf8"
- title: Simple
icon: code
desc: Just markdown
accent: "#34d399"
``` Key metrics display:
```stats
- 85 KB | Player Bundle
- <100ms | Build Time
- 346 | Tests Passing
``` Diagrams via Mermaid syntax:
```mermaid
graph LR
A[Markdown] --> B[Compiler]
B --> C[.cup File]
C --> D[Player]
``` Data visualizations via Chart.js:
```chart
type: bar
labels: [Q1, Q2, Q3, Q4]
datasets:
- label: Revenue
data: [10, 25, 40, 60]
``` Progressive flow diagrams that reveal nodes step-by-step with pause markers:
```flow
direction: LR
[input] Raw Data
[process] Transform
[output] Results
input --> process : clean
process --> output : validate
``` Nodes are defined with [id] Label. Edges use from --> to : label. Direction can be LR (left-right) or TD (top-down). Each node reveals progressively with click-to-advance.
Styled callout boxes for tips, warnings, and important information:
```callout:info
Use `mycuppa serve --watch` for live reload during development.
```
```callout:warning
This will overwrite existing files in the output directory.
```
```callout:tip
Combine `--from` with `--refine` to iteratively improve AI output.
```
```callout:danger
Never commit your API key to source control.
``` Four types: info (blue), warning (amber), tip (green), danger (red). Each has a matching icon and color scheme.
Display REST API endpoints with method badges, parameters, and response examples:
```api
POST /api/v2/inventory
Create or update inventory records in bulk.
name | type | required | description
sku | string | yes | Product SKU identifier
quantity | int | yes | Stock quantity
warehouse | string | no | Warehouse code (default: "primary")
Response (201 Created):
json
{ "updated": 3, "errors": [] }
``` Methods: GET, POST, PUT, PATCH, DELETE — each styled with a distinct color badge.
Directory structure visualization with box-drawing characters:
```tree
root: payment-service/
src/
handlers/
*checkout.ts
refund.ts
models/
order.ts
index.ts
tests/
package.json
``` Indent with 2 spaces for nesting. Prefix with * to highlight a file. Trailing / marks directories. The root: directive sets the tree label.
Code diffs with line-by-line added/removed highlighting:
```diff
- const cache = new Map();
- function getUser(id) {
+ const cache = new LRUCache({ max: 1000 });
+ async function getUser(id) {
if (cache.has(id)) return cache.get(id);
- const user = db.query(id);
+ const user = await db.query(id);
cache.set(id, user);
return user;
}
``` Lines starting with + show in green, - in red. Unchanged lines display normally.
Horizontal or vertical timelines for milestones and chronological events:
```timeline
direction: vertical
- label: Incident Detected
date: 14:32 UTC
desc: Monitoring alerts fire for elevated error rates
color: "#ef4444"
- label: Root Cause Found
date: 14:58 UTC
desc: Bad config deployed to payment-service
color: "#f59e0b"
- label: Fix Deployed
date: 15:15 UTC
desc: Config rollback and service restart
color: "#22c55e"
``` Direction: horizontal (default) or vertical. Each item supports label, date, desc, icon, and color.
A visual separator between elements on the same slide.
Cuppa Studio auto-detects the best layout for each slide, but you can override with the layout directive:
| Category | Layout | Use Case |
|---|---|---|
| Title | intro | Opening slide with title + subtitle |
| Title | section | Section divider |
| Title | end | Closing slide |
| Title | quote | Centered blockquote |
| Content | center | Centered content |
| Content | header-body | Heading + body content |
| Content | split | Two-column layout |
| Content | code-focus | Code block prominent |
| Media | image-left | Image on left, text right |
| Media | image-right | Image on right, text left |
| Media | image-full | Full-bleed image background |
| Media | image-grid | Responsive grid of images (auto-detected with 2+ images) |
| Special | full | Edge-to-edge content |
| Special | blank | Empty canvas |
Two equivalent ways to set a layout:
---
layout: image-grid
---

 Or using an HTML comment directive (also works for class, background, transition):
<!-- layout: image-grid -->

 When a directive comment appears mid-slide, it automatically starts a new scene.
The image-grid layout displays 1+ images in a responsive horizontal row. Auto-detected when a slide has 2 or more images.
---
layout: image-grid
---


 Add class: vertical for a single-column stack:
---
layout: image-grid
class: vertical
---

 Control how slides transition:
| Transition | Description |
|---|---|
fade | Cross-fade between slides (default) |
slide | Direction-aware slide animation |
zoom | Zoom in/out transition |
reveal | Reveal with clip-path wipe |
flip | 3D flip between slides |
morph | Morph transition with scale and rotation |
none | Instant switch |
Elements are automatically animated based on their type. Available animation names:
| Animation | Description |
|---|---|
fadeIn | Fade in from transparent |
fadeOut | Fade out to transparent |
fadeInUp | Fade in while sliding up |
fadeInDown | Fade in while sliding down |
fadeInLeft | Fade in from the left |
fadeInRight | Fade in from the right |
slideUp | Slide up from below |
slideDown | Slide down from above |
zoomIn | Zoom in from small with bounce |
bounceIn | Scale up with elastic bounce |
blurIn | Fade in with blur-to-sharp |
typewriter | Character-by-character reveal |
revealDown | Reveal from top to bottom (code blocks) |
scale | Scale up from zero |
highlight | Highlight background pulse |
codeStep | Step through highlighted code line groups |
chartStep | Reveal chart datasets one at a time |
flowReveal | Progressively reveal flow diagram nodes |
Add notes that appear in the presenter view:
<!-- notes: Your speaker notes here.
Can be multi-line. -->