SlideDeck is the top-level provider component that wraps your slides layout. It manages navigation state, keyboard events, ViewTransition animations, and optional presenter sync.
Role
SlideDeck provides the infrastructure for your presentation:
- Keyboard navigation — Arrow keys and spacebar to navigate slides
- ViewTransition animations — Smooth directional transitions powered by React 19
- Progress indicators — Visual feedback with dots and a counter
- Exit button — Optional × button when
exitUrlis set - Presenter sync — Broadcasts slide changes to a notes page via API endpoint
Basic Setup
PlaceSlideDeck in your slides layout (e.g. app/slides/layout.tsx):
app/slides/layout.tsx
SlideDeck is a client component, so your layout can stay a server component — no "use client" needed.Configuration
Required Props
slides(ReactNode[]) — Your slides arraychildren(ReactNode) — Route content rendered by Next.js
Optional Props
basePath(string) — URL prefix for slide routes. Defaults to"/slides"exitUrl(string) — URL for exit button (×). Shows in top-right when setshowProgress(boolean) — Show dot progress indicator. Defaults totrueshowCounter(boolean) — Show “3 / 10” counter. Defaults totruesyncEndpoint(string) — API route for presenter ↔ phone syncspeakerNotes((string | ReactNode | null)[]) — Notes per slide (same index)className(string) — Additional class for the deck container
Common Configurations
With Speaker Notes and Sync
app/slides/layout.tsx
Multiple Decks
UsebasePath for a different URL and className for scoped styling:
app/slides-alt/layout.tsx
Minimal (No UI)
Disable progress indicators for a clean presentation:How It Works
Route Detection
SlideDeck uses the current pathname to determine if you’re on a slide route:
slide-deck.tsx
/slides/1, /slides/2, etc., it shows progress indicators and enables keyboard navigation. Pages like /slides/demo are breakout pages — they inherit the slide deck’s layout but don’t render navigation UI.
Prefetching
SlideDeck prefetches adjacent slides for instant navigation:
slide-deck.tsx
Presenter Sync
WhensyncEndpoint is provided, SlideDeck POSTs the current slide on navigation:
slide-deck.tsx
Layout Requirements
Correct
app/slides/layout.tsx
Incorrect
app/slides/layout.tsx
className prop instead:
TypeScript
types.ts
Related
- Routing — How
getSlideandgenerateSlideParamswork - Keyboard Navigation — Arrow keys and spacebar behavior
- Animations — ViewTransition details
- Speaker Notes — Setting up presenter sync