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.
| Prop | Type | Default | Description |
|---|---|---|---|
product* | Product | — | Undocumented — add TSDoc to the prop in the library. |
chapters | CourseChapter[] | — | Override `product.courseModules`. Supply this to render a chapter tree the product row does not carry — the module→chapter conversion is `modulesToChapters`, exported above. |
isMobile | boolean | — | 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. |
initialChapterIndex | number | 0 | Chapter showing on mount. |
initialLessonIndex | number | 0 | Lesson within that chapter showing on mount. |
onLessonChange | (position: { chapterIndex: number; lessonIndex: number; lesson?: PlayerLesson; }) => void | — | Fires whenever the active lesson changes. |
initialOpenChapters | string[] | ["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. |
defaultLessonOpen | boolean | false | Mobile lesson player open on mount. Mobile tree only. |
lessonOpen | boolean | — | Controlled mobile lesson-player state. Wins over `defaultLessonOpen`. |
onLessonOpenChange | (open: boolean) => void | — | Undocumented — add TSDoc to the prop in the library. |
defaultLightboxOpen | boolean | false | Fullscreen lightbox open on mount — only meaningful when the lesson has a `videoUrl`. |
showUpNextFooter | boolean | true | Render the floating "Up next" bar. It is `position: fixed`, so a docs page may want it off. |
autoPlayVideo | boolean | true | Autoplay the lesson `<video>`. The app hardcoded `autoPlay`; a snapshot should not start playing, so a story can turn it off. |
className | string | — | 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.