Skip to content

Presentation Mode

The <Presentation> component turns Elucim into a full slide-deck system. Each <Slide> can contain its own <Player> with independent animations, and transitions handle movement between slides.

PropTypeDefaultDescription
widthnumber1920Slide width in pixels
heightnumber1080Slide height in pixels
backgroundstring'#0d0d1a'Default background color for all slides
transitionstring'none'Transition type: 'none' | 'fade' | 'slide-left' | 'slide-up' | 'zoom'
transitionDurationnumber400Transition duration in milliseconds
showHUDbooleantrueShow the slide counter overlay
showNotesbooleanfalseShow the presenter notes panel
startSlidenumber0Zero-based index of the initial slide
onSlideChange(index: number) => voidCallback fired when the active slide changes
childrenReact.ReactNodeMust be <Slide> components
PropTypeDefaultDescription
titlestringSlide title (displayed in the HUD and presenter view)
notesstringPresenter notes (shown when showNotes is enabled)
backgroundstringBackground color override for this slide
childrenReact.ReactNodeSlide content — any Elucim components, HTML, or a <Player>
import { Presentation, Slide, Player, FadeIn, Text, LaTeX } from '@elucim/core';
<Presentation
width={1920}
height={1080}
transition="fade"
transitionDuration={500}
showHUD
>
<Slide title="Welcome" notes="Introduce the topic">
<Player width={1920} height={1080} fps={30} durationInFrames={90}>
<FadeIn duration={30}>
<Text x={960} y={540} fill="#fff" fontSize={64} textAnchor="middle">
Welcome to Elucim
</Text>
</FadeIn>
</Player>
</Slide>
<Slide title="The Math" notes="Show the core equation">
<Player width={1920} height={1080} fps={30} durationInFrames={60}>
<FadeIn duration={20}>
<LaTeX expression="e^{i\\pi} + 1 = 0" x={960} y={500} fontSize={48} />
</FadeIn>
</Player>
</Slide>
</Presentation>
InputAction
/ Next slide
/ Previous slide
SpaceNext slide
Click navigation buttonsNext / previous slide
FToggle fullscreen

Use usePresentationContext() inside any component rendered within a <Presentation> to access slide state and navigation:

import { usePresentationContext } from '@elucim/core';
function SlideCounter() {
const { slideIndex, totalSlides, goTo, next, prev, isFullscreen, toggleFullscreen } =
usePresentationContext();
return (
<div>
Slide {slideIndex + 1} / {totalSlides}
<button onClick={prev}>Prev</button>
<button onClick={next}>Next</button>
<button onClick={toggleFullscreen}>
{isFullscreen ? 'Exit' : 'Fullscreen'}
</button>
<button onClick={() => goTo(0)}>Go to start</button>
</div>
);
}
PropertyTypeDescription
slideIndexnumberCurrent slide index (zero-based)
totalSlidesnumberTotal number of slides
goTo(index)(number) => voidJump to a specific slide
next()() => voidAdvance to the next slide
prev()() => voidGo back to the previous slide
isFullscreenbooleanWhether the presentation is in fullscreen mode
toggleFullscreen()() => voidToggle fullscreen on/off

The Presentation component is fully theme-aware. All UI elements (navigation arrows, fullscreen button, HUD text, progress dots) use currentColor and CSS color-mix(), so they automatically adapt to any light or dark color scheme.

Pass a CSS custom property for the background prop to let your site’s theme control the slide background:

<Presentation background="var(--slide-bg, #1a1a2e)" />

Players inside a Presentation automatically detect the context and become transparent with fill sizing. Always set controls={false} so the Presentation’s own HUD handles navigation:

<Slide title="Animated Math">
<Player width={700} height={400} fps={30} durationInFrames={90}
autoPlay loop controls={false}>
<FadeIn duration={25}>
<Text x={350} y={150} fill="currentColor" fontSize={36} textAnchor="middle">
Theme-aware text
</Text>
</FadeIn>
</Player>
</Slide>

Using fill="currentColor" in your slide content ensures text and shapes inherit the theme color automatically.