Your first slidepig deck
Create your first slide deck.
Follow this guide as a page, or press F to turn it into a deck.
You will need Node.js 22.12 or newer and npm. slidepig uses React 19 or newer.
01 · Set up your project
Create a presentation project.
The scaffold copies a working example from the package, including a deck, an image pipeline, and a Cloudflare Worker configuration. The --skill option also installs the agent instructions in .agents/skills/slidepig/SKILL.md. Ask your coding agent to read that file and customize the deck.
Give your agent a topic, audience, goal, and any brand assets. For example: ‘Make a six-slide product demo for our team. Start with an outline, use our screenshots, and finish with next steps.’ Run the commands below if you prefer to set up the project yourself.
npx slidepig@latest create my-decks --skill
cd my-decks
npm install
npm run dev02 · Your deck is a file
Edit your deck file.
Run npm run new -- my-pitch to create src/decks/my-pitch.ts. Its filename becomes its URL: /my-pitch/ in the starter. Each slide needs an id and a title. Give the id a stable name so shared links keep working.
Edit a title or paragraph directly, or ask your agent: ‘Shorten the intro and turn the next steps into a timeline.’ Start with plain text and built-in layouts. Use a .tsx deck when you need React content or a custom layout.
import { defineDeck } from "slidepig";
export default defineDeck({
title: "My pitch",
description: "An idea worth sharing.",
slides: [
{ id: "hello", layout: "hero", title: "Hello, world." },
{
id: "plan",
title: "Here is the plan.",
body: ["One idea per slide. Room to explain it."],
},
],
});03 · Add images and styles
Try the look before editing the code.
On localhost, press D to open the visual tuner. Try backgrounds, overlays, themes, and accents. Copy the resulting settings into your deck file to keep them; the tuner does not save your source.
Bring your own screenshots, brand colors, and illustrations. If you generate art with an image tool, save it in public/ and ask your agent to add it to deck.media. For example, public/photo.jpg becomes /photo.jpg. Reference media ids from slides; npm run build optimizes configured images and prerenders the pages.
- See custom layoutsReact components, visuals, and scoped CSS
04 · Present and share
Present your deck or save a PDF.
- 01
Save as PDF
Open your browser’s Print menu and choose Save as PDF to download a printable copy of the deck.
- 02
F / Esc
Enter presentation mode; return to reading. The Present button works on touch screens.
- 03
↑ / ↓
Move between slides while presenting.
- 04
← / →
Move through the active media carousel.
- 05
Space
Play or pause the slide's video while presenting.
- 06
#plan
Share a slide directly by adding its id to the page URL.
05 · Publish your deck
Build, preview, then publish.
npm run build optimizes images, prerenders pages, and checks decks, HTML, links, and local assets. Fix any build errors before publishing. npm run preview serves the result through the Cloudflare Worker locally.
For Cloudflare, set your Worker name in wrangler.jsonc, authenticate with Wrangler, and run npm run deploy. Configure your custom domain in Cloudflare and set SITE_ORIGIN to that origin when building, so canonical URLs point to your site. The generated dist/ pages can also be served by another static host; configure clean URLs and the 404 page there.
npm run build
npm run preview
# When ready, with Cloudflare configured:
# SITE_ORIGIN=https://decks.example.com npm run build
# npm run deployAlready have a React app?
Add a deck to your React app.
Install slidepig in a React 19+ app and import its CSS once. On a page with its own main landmark, pass embedded so the deck becomes a labelled region. Its styles are scoped to the deck.
A deck can also own the whole page: omit embedded, or use mountDeck from slidepig/client to render or hydrate it into an element.
- Full API and recipesProps, themes, media, layouts, and headless hooks
- Back to slidepigExamples and getting started
import { Deck, defineDeck } from "slidepig";
import "slidepig/styles.css";
const deck = defineDeck({
title: "Our next chapter",
slides: [{ id: "hello", title: "An idea worth sharing." }],
});
export function Pitch() {
return <Deck deck={deck} embedded />;
}