slidepig: decks that are web pages
This page is a slide deck.
Scroll it like an article, or press F (or Present, bottom left) to give it as a talk. Same page, same URL, same content.
It is built with slidepig, and it explains what slidepig is for.
slidepig
Write a deck once. Read it, or present it.
slidepig is a lightweight React library for presentations. Build a deck with your coding agent or write simple slide data yourself. Share a page people can read, then press F to present it as slides.
The link you send before the meeting is the deck you present in it. Your content stays in your project, ready for the next edit.
The problem
A presentation people can read after the meeting.
A pitch usually lives twice: as slides for the meeting and as a PDF or doc for everyone who missed it. The PDF loses playable media, asks phone readers to zoom around, and makes sharing one idea harder than sending a slide link.
A web page fixes all of that, until you try to present it. Scrolling in front of an audience is clumsy, and nothing tells you where one idea ends.
slidepig keeps the page and adds the missing mode. Every slide is a section with its own URL, and presenting is just a different way of showing the same sections.
A brief, a deck, a few small edits.
The bundled skill teaches your coding agent the slide format, layouts, styling, and checks. Start with a brief, then keep refining the same slide files.
- 01
Give it a direction
Share your topic, audience, goal, and any brand assets. Ask for a short outline before the full deck.
- 02
Ask for a revision
Try: ‘Shorten the intro and make the next steps a timeline.’ Or edit a title directly in the slide file.
- 03
Make it yours
Add screenshots or illustrations from your preferred image tool. Custom React components can bring a chart or working demo into the presentation.
The model
Your deck is data. The library is the stage.
You describe slides as plain objects: an id, a title, some paragraphs, a layout, and the media they show. defineDeck infers every media id, theme and background name, so a typo is a type error instead of a blank square on stage.
<Deck> renders them with built-in layouts for text, lists, timelines, and more. Use a React component as a slide’s visual when you need a chart or demo. Custom layouts and CSS can stay alongside your deck.
import { defineDeck } from "slidepig";
export default defineDeck({
title: "Our next project",
backgrounds: {
night: { src: "/art/night.jpg" },
},
slides: [
{
id: "hello",
layout: "hero",
tone: "dark",
background: "night",
title: "Write it once.",
body: ["Read it, or present it."],
},
],
});A small library
Small enough to get out of the way.
slidepig grew out of two real pitch decks. The library keeps their shared mechanics small; your content, visuals, and custom components stay in your project.
Benefits
Better for everyone in the room, and everyone who wasn't.
The same page serves three people: the reader who opens the link alone, the presenter on stage, and the author who has to change slide six an hour before the meeting.
For the audience
Every slide has a link
Share #numbers and it opens on that slide, in either mode.
Reads on a phone
Reading mode is a responsive article, not a shrunken slide.
Accessible by default
Real headings, skip link, focus management, labelled controls, reduced motion.
For the presenter
Keyboard first
F presents, ↑ ↓ change slides, Esc returns to reading.
Media that cooperates
← → drive the active carousel; Space plays the slide's video.
Next slide is ready
Images for the next slide are fetched and decoded before you advance.
For the author
Typed content
Slides are data with inferred names, checked at build time.
Live visual tuner
Adjust backgrounds and colors in the browser, copy the result back to code.
Optimized images
AVIF and WebP derivatives, blur placeholders, preload hints.
Media that behaves
Carousels, lightboxes and video, wired to the presenter.
Name media once in a registry and reference it by id from any slide. Images open in a lightbox; groups become a carousel the arrow keys control while presenting.
Missing files are not errors. A media entry without a src renders a labelled placeholder, so a draft deck never looks broken, it just looks unfinished.
What a missing file looks like
The entry below has a title and a description but no src yet. It renders as a labelled slot, so reviewers see what is planned rather than a broken player.
Design in the browser
Tune the look live, then hand the result to your editor.
Press D to open the tuner on every slide. Swap backgrounds, pick a theme, drag the overlay opacity, try accent colors, and see them applied as you go.
Copy the settings and you get a ready-to-paste snippet that names the slide, which also makes a precise prompt for a coding agent. The tuner never writes files, and by default it only exists on localhost.
Package boundary
slidepig owns the mechanics. You own the deck.
The library never scans your DOM or guesses at your content. It handles navigation, presenting, preloading, media behavior and the chrome around slides. Everything that makes a deck yours stays in your repository.
What lives where
- slidepig
- Hash navigation, keyboard and fullscreen, preloading, controls, layouts, lightbox and carousel, the tuner. Zero runtime dependencies; React is a peer.
- slidepig/site and slidepig/assets
- Optional build tooling in the same package: prerendered sites, validation, a Worker, and AVIF/WebP derivatives.
- Your deck
- Copy, media registry, themes and backgrounds, custom visuals, and any CSS you want to override.
Use only the parts you need
One package, imported by path. slidepig/react exports the headless useSlideshow hook and SlideshowControls for a fully custom renderer. slidepig/core has the framework-free navigation and preload helpers. Build tools such as sharp are optional peers, so a page that embeds one deck installs nothing else.
Three steps
From an empty folder to a deck you can present.
slidepig works in any React app: Vite, Next.js, TanStack Start, Remix. Every slide is in the rendered HTML, so server rendering and static export work without extra setup.
- 01 · Install
npm i slidepig
Import
slidepig/styles.cssonce. React 19 or newer is required; React and React DOM are peers. - 02 · Write
defineDeck({ … })
Slides, media and themes as typed data, in one file you can review in a pull request.
- 03 · Render
<Deck deck={deck} />
Deploy it like any page. Press F when it is your turn to speak.
That was the demo
You just read a deck. Now press F and present it.
Everything on this page came from one data file and one component. Open the source of this demo next to it, and change a title, to see how little stands between an idea and a deck.
- Read the READMEInstall, API and recipes
- Start a siteA starter project and bundled agent skill