PresenterView
presenter-viewDual-screen presenter console with current/next slide previews, speaker notes, timer, and BroadcastChannel sync.
Usage
Standard Presenter Console
Shows the live current slide on the left, next step/slide preview and resizable speaker notes on the right, and quick jump controls along the bottom.
Dual-Screen Presentation & Live Collaboration
Dual-Screen Presentation & Live Collaboration
<PresenterView slides={slides} channelName="q4-keynote" />Countdown Mode & Overtime Alert
In countdown mode, time highlights with a warning color under 1 minute and turns negative with danger styling on overtime.
<PresenterView slides={slides} timerMode="countdown" countdownSeconds={900} />When to Use
Use PresenterView for keynotes, web slide decks, and classroom presentations where the audience screen and the presenter's laptop display different views. It reuses the exact same slides array as SlideDeck and syncs slide index and fragment steps bidirectionally across same-origin windows via native BroadcastChannel when channelName is set.
For standalone responsive stage scaling use FitScreen; for live stage annotations use StageDraw.
Import
import { PresenterView, formatDuration, formatClockTime, computeNextPreview } from "@hulianui/ui"Props
| Name | Type | Default | Description |
|---|---|---|---|
| slides* | SlideDeckItem[] | — | Array of slides shared with SlideDeck |
| index | number | — | Controlled current slide index (0-based) |
| defaultIndex | number | 0 | Uncontrolled initial slide index |
| onIndexChange | (index: number) => void | — | Called when the active slide index changes |
| step | number | — | Controlled fragment reveal step for the current slide (0-based) |
| defaultStep | number | 0 | Uncontrolled initial fragment step |
| onStepChange | (step: number) => void | — | Called when the current fragment step changes |
| designWidth | number | 1920 | Design width (px) passed to internal FitScreen previews |
| designHeight | number | 1080 | Design height (px) passed to internal FitScreen previews |
| channelName | string | — | Optional BroadcastChannel name for bidirectional live sync with SlideDeck; requests current state on mount |
| timerMode | "elapsed" | "countdown" | "elapsed" | Timer display mode (can also be toggled live in the header) |
| countdownSeconds | number | 900 | Countdown target in seconds (15 minutes by default); highlights warning at <= 60s and danger with negative overtime below 0 |
| autoStartTimer | boolean | false | Starts the presentation timer automatically on mount |
| defaultNotesFontSize | number | 16 | Initial speaker notes font size in px (clamped to 12..32) |
| keyboard | boolean | true | Enables keyboard shortcuts (ArrowRight, Space, PageDown, ArrowLeft, PageUp, Home, End) |
| headerExtra | ReactNode | — | Extra slot rendered on the right side of the header |
| footerExtra | ReactNode | — | Extra slot rendered on the right side of the footer |
| labels | Partial<PresenterViewLabels> | Built-in defaults | Overrides UI strings and accessible labels |
| className | string | — | Custom class name on the root element |
Exported Helpers
formatDuration(seconds: number): string— Formats seconds asMM:SSorHH:MM:SS, including negative overtime (e.g.-75 -> "-01:15").formatClockTime(date: Date): string— Formats a 24-hour wall clock stringHH:MM:SS.computeNextPreview(slides, index, step)— Returns{ kind: "step" | "slide" | "end", ... }describing the next preview target.
Pitfalls
BroadcastChannelonly delivers messages between same-origin browser tabs or windows. For cross-origin or multi-device setups, controlindexandstepexternally via WebSocket.- Both preview panes render inside
<FitScreen interactive={false} />so presenters cannot accidentally click interactive controls inside preview thumbnails.
Related
Playground
Dual-Screen Presentation & Live Collaboration
Dual-Screen Presentation & Live Collaboration
<PresenterView slides={slides} timerMode="elapsed" />