Skip to content

Store

Course player

Lesson playback with the module outline beside it.
Available
Needs mock props

Examples

Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.

Course player

Rendered live from Storybook

Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.

Props

The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.

PropTypeDefaultDescription
product*Product—Undocumented — add TSDoc to the prop in the library.
chaptersCourseChapter[]—Override `product.courseModules`. Supply this to render a chapter tree the product row does not carry — the module→chapter conversion is `modulesToChapters`, exported above.
isMobileboolean—Overrides the measured viewport. `undefined` (the default) uses the live viewport; pass `true`/`false` to force the mobile or desktop tree so BOTH are renderable at any width.
initialChapterIndexnumber0Chapter showing on mount.
initialLessonIndexnumber0Lesson within that chapter showing on mount.
onLessonChange(position: { chapterIndex: number; lessonIndex: number; lesson?: PlayerLesson; }) => void—Fires whenever the active lesson changes.
initialOpenChaptersstring[]["chapter-0"]Accordion sections expanded on mount. Values are `chapter-<index>`.
initialMobileTab"overview" | "lessons""lessons"Which mobile tab is active on mount. Mobile tree only.
defaultLessonOpenbooleanfalseMobile lesson player open on mount. Mobile tree only.
lessonOpenboolean—Controlled mobile lesson-player state. Wins over `defaultLessonOpen`.
onLessonOpenChange(open: boolean) => void—Undocumented — add TSDoc to the prop in the library.
defaultLightboxOpenbooleanfalseFullscreen lightbox open on mount — only meaningful when the lesson has a `videoUrl`.
showUpNextFooterbooleantrueRender the floating "Up next" bar. It is `position: fixed`, so a docs page may want it off.
autoPlayVideobooleantrueAutoplay the lesson `<video>`. The app hardcoded `autoPlay`; a snapshot should not start playing, so a story can turn it off.
classNamestring—Undocumented — add TSDoc to the prop in the library.

Reference

Transcribed from the component audit. If this disagrees with the source, the source is right.

Source
src/components/store/CoursePlayer.tsx
Portability
Needs its app dependencies replaced by props before it renders in isolation.
Notes
Its module-to-chapter mapping and duration formatter are exported.