Slidebook
Slidebook is a flexible ecosystem for building AI-assisted presentations with code.
OverviewΒ
Slidebook is a developer-friendly tool for creating and running slideshows using JSX, Tailwind, and motion β with built-in live preview, collaboration, theming, and more.
It consists of four packages:
Package | Description |
---|---|
@slidebook/cli | CLI tool to develop, build, run, or eject a Slidebook project. |
@slidebook/core | Internal logic and components β embed slides, manage layout, sync state. |
@slidebook/image | A ready-to-use version of Slidebook without custom coding. |
@slidebook/server | Real-time collaboration server β slide syncing, remote control, etc. |
Modes of OperationΒ
π’ Simplified ModeΒ
Zero configuration needed. Just create a slides/
folder and drop in your slides:
slides/
1.tsx
2.tsx
slide-3.tsx
π§ Professional ModeΒ
Offers full control over structure and rendering.
Run:
slidebook eject
This will scaffold a full Next.js app using @slidebook/core
.
How to UseΒ
CommandsΒ
slidebook dev # Start local server with hot reload
slidebook build # Build the app
slidebook start # Run production build
slidebook eject # Switch to full custom project mode
Recommended StackΒ
- Tailwind CSS (colors & themes pre-configured)
- Framer Motion
- Next.js features (server components, async data fetching)
Note
All slides are React Server Components by default, so you can fetch data directly inside a slide:
const data = await db.query("SELECT * FROM ...");
FeaturesΒ
- π‘ AI-powered generation of slide content
- π§ Live collaboration via @slidebook/server
- π¨ Themes: Easily switch color schemes
- π± Remote control: Open QR code, change theme, navigate on your phone or any other device and control the deck
- ποΈ Host view: View speaker notes and slides preview
- π List view: Browse and jump between all slides
ConfigurationΒ
Settings can be passed via:
- Environment variable (env)
- CLI argument (arg)
- Config file (config)
- Default fallback (default)
Priority: arg > env > config > default
Example slidebook.config.js
Β
// @ts-check
/**
* @type {import('@slidebook/cli/lib/config').Config}
*/
export default {
slide: {
width: 1200,
height: 600,
},
app: {
serverUrl: "http://localhost:3000",
qrUrl: "https://slidebook.dev",
port: 3000,
},
auth: {
password: "qwerty",
},
};
Full OptionsΒ
Key | config path | arg | env var | Default |
---|---|---|---|---|
serverUrl | app.serverUrl | --serverUrl | SERVER_URL | β |
qrUrl | app.qrUrl | --qrUrl | QR_URL | β |
port | app.port | --port | PORT | 3000 |
password | auth.password | --password | PASSWORD | qwerty |
width | slide.width | --slideWidth | SLIDE_WIDTH | 1200 |
height | slide.height | --slideHeight | SLIDE_HEIGHT | 600 |
cookiesFlags | cookies.flags | --cookiesFlags | COOKIES_FLAGS | SameSite=Strict; |
authenticate | auth.authenticate | β | β | β |
validate | auth.validate | β | β | β |
Real-Time SyncΒ
When the host changes a slide, theme, or QR code:
- All connected clients (viewers or other hosts) update instantly.
- QR and theme sync across devices.
Host ViewΒ
Shows:
- Current slide
- Next slide
- Speaker notes
- Navigation controls
Requires host password to access. Set via config, CLI, or env (read more).
ThemesΒ
Add a theme by importing it into layout.tsx
(pro mode) or layer.tsx
(simplified mode):
import "@slidebook/core/lib/assets/themes/pink-neutral.css";
Available themes:
- blue-neutral
- blue-slate
- green-neutral
- green-slate
- orange-neutral
- orange-slate
- pink-neutral
- pink-slate
Project Structure (Pro Mode)Β
.
βββ src/
β βββ app/ # Next.js app directory
β β βββ [[...pathname]]/ # Slide route segment
β β β βββ page.tsx # Renders current slide
β β βββ layout.tsx # App layout with theme and wrapper
β β βββ globals.css # Global styles
β ββββslides/ # Your slides, one file per slide
β βββ 0.tsx # First slide
β βββ 1.tsx # Second slide
β βββ index.tsx # Optional wrapper for all slides
βββ public/ # Static assets
βββ slidebook.config.js # Config file
βββ package.json
Slides segmentΒ
import { RootPage } from "@slidebook/core/lib/components/root-page";
import { generateStaticParamsFactory } from "@slidebook/core/lib/lib/generate-static-params";
import { slides } from "../slides";
export const generateStaticParams = generateStaticParamsFactory(slides.length);
export default async function SlidePage({ params }: { params: Promise<{ pathname: string[] }> }) {
const { pathname } = await params;
return <RootPage segments={pathname} slides={slides} />;
}
Slides definitionΒ
export const slides = [
{ component: Slide1, notes: Notes1 },
{ component: Slide2 },
];
LayoutΒ
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import { SlideLayer } from "@slidebook/core/lib/components/slide-layer";
import { Layer } from "./slides/layer";
import "./globals.css";
import "@slidebook/core/lib/styles.css";
export const metadata: Metadata = {
title: "Slidebook",
description: "Advanced presentation tool",
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body className={Inter({ subsets: ["latin"] }).className}>
<Layer>
<SlideLayer>{children}</SlideLayer>
</Layer>
</body>
</html>
);
}
export const dynamic = "error";
Project structure (Simplified Mode)Β
.
βββ slides/ # Your slides, one file per slide
β βββ 0.tsx # First slide
β βββ 1.tsx # Second slide
β βββ layer.tsx # Optional wrapper for all slides
βββ public/ # Static assets
βββ slidebook.config.js # Config file
βββ package.json
SlideΒ
export const Slide = () => (
<h1 className="text-4xl font-bold text-center text-white">Hello World</h1>
);
export const Notes = () => (
<p>Welcome notes for host view</p>
)
LayerΒ
export const Layer = ({ children }) => (
<div className="p-12">{children}</div>
);
βοΈ Running the AppΒ
You can start the presentation app and server together or separately.
β Recommended: TogetherΒ
slidebook start
Runs both server and editor in one command β enabling:
- Real-time sync across devices
- QR code sharing
- Host view & navigation
Tip
Recommended for local use and self-hosting
π§© Alternative: Separate processesΒ
slidebook start server
slidebook start app
Useful if you're deploying to environments like Vercel, which do not support WebSocket or real-time infrastructure.
Important
When running separately, pass the server URL to the app
// slidebook.config.js
export default {
app: {
serverUrl: "https://your-slidebook-server.example.com",
},
};
π¦ DeploymentΒ
To static hosts (Vercel, Netlify)Β
Only the app can be deployed. Real-time features will be unavailable unless the server is deployed separately.
To self-hosted server (Docker, Fly.io)Β
Run slidebook start
or split as needed. Pass serverUrl
when decoupling.
AdditionalΒ
Please consider giving a star if you like it, this motivates the author to continue working on this and other solutions β€οΈ
Create issues with wishes, ideas, difficulties, etc. All of them will definitely be considered and thought over.