Props Reference
Required Props
| Prop | Type | Description |
|---|---|---|
lesson | TeachariumLessonExport | The lesson data in export format |
You must provide either widgets or puckConfig:
| Prop | Type | Description |
|---|---|---|
widgets | TeachariumWidget[] | List of widgets (recommended for most cases) |
puckConfig | Config | Pre-built Puck config for advanced use cases |
Optional Props
| Prop | Type | Default | Description |
|---|---|---|---|
config | Partial<PlayerConfig> | {} | Player configuration options |
mode | "player" | "review" | "player" | Playback mode (review disables interactions) |
initialSessionState | SessionState | undefined | Resume from saved session state |
mediaResolvers | MediaResolverConfig | No-op | Hooks for resolving media URLs |
onStepChange | (state: SessionState) => void | undefined | Called at step boundaries for auto-saving |
onComplete | (result: CompletionResult) => void | undefined | Called when lesson completes |
onProgress | (info: ProgressInfo) => void | undefined | Called with step/section position as it changes |
onEvent | (event: { type: string }) => void | undefined | Receives every internal lesson event |
renderFooter | (controls: PlayerFooterControls) => ReactNode | undefined | Replace the built-in footer (see below) |
additionalComponents | Record<string, ComponentConfig> | undefined | Extra Puck components (when using widgets) |
className | string | undefined | CSS class for container |
showStartButton | boolean | true | Show start button overlay |
startButtonText | string | "Start" | Custom start button text |
headerContent | React.ReactNode | undefined | Content above the player |
sideContent | React.ReactNode | undefined | Content alongside the player (e.g., debug panel) |
mediaResolvers accepts useMediaUrl, useVoiceoverUrl and useVideoUrls. See Media Resolution.
Custom Footer
Pass renderFooter to draw your own footer instead of the built-in one. It’s rendered in the footer slot, inside the player, in both "player" and "review" mode. It isn’t rendered when config.showProgress is false.
<TeachariumPlayer
lesson={lesson}
widgets={widgets}
renderFooter={(controls) => (
<footer>
<button onClick={controls.previous} disabled={!controls.canGoPrevious}>
Previous
</button>
<button
onClick={controls.next}
disabled={
controls.nextButton.status === "disabled" ||
(!controls.isLastStep && !controls.canGoNext)
}
>
{controls.nextButton.label}
</button>
</footer>
)}
/>Lessons drive the same state they drive in the built-in footer. A step can disable Next until it’s answered, show a footer Check Answer or Hint button, relabel Next, or show feedback, so render those when they’re present. The Sample Apps have full examples.
PlayerFooterControls
| Field | Type | Description |
|---|---|---|
mode | "player" | "review" | The player’s mode |
progress | FooterProgress | sectionIndex, sectionCount, stepIndex, stepCount (within the section), lessonStepIndex, lessonStepCount (whole lesson) |
isLastStep | boolean | On the last step (review: the last recorded step) |
canGoNext / canGoPrevious | boolean | Whether there is a step in that direction |
nextButton | { status, label } | status is "enabled", "disabled" or "hidden"; label is "Next", "Done" on the last step, or a lesson’s custom label |
previousButton | { status, label } | What the lesson asks for. The built-in footer only shows Previous when a lesson enables it; your footer can show it whenever canGoPrevious is true |
checkAnswerButton | { status, label } | A footer Check Answer button requested by the lesson (hidden by default) |
hintButton | { status, label } | A footer Hint button requested by the lesson (hidden by default) |
progressBarVisible | boolean | Whether the lesson wants progress shown |
feedback | { message, variant, isVisible, autoHideMs?, showNextButton? } | Feedback to show. variant is "correct", "incorrect", "info" or "hint"; message may contain markdown |
timeRemaining / showCountdown | number | undefined / boolean | Step timer, when a lesson uses one |
next() | function | Go to the next step; completes the lesson on the last step (review: Done) |
previous() | function | Go back one step |
checkAnswer() / showHint() | function | Press the footer Check Answer / Hint button |
dismissFeedback() / feedbackNext() | function | Close the feedback, or press its own Next button |
getSessionState() | () => SessionState | The session right now, including answers on the current step. Save it when the learner leaves mid-step |
The same object is available from the usePlayerFooterControls and useReviewFooterControls hooks if you build a footer as a component inside the player.