Course Detail Page

Full course detail layout

Marketing BlockEducation

Overview

A compound component for building an LMS-style course detail page. The sidebar renders modules with accordion sections; each lesson has a status icon. The content area holds the lesson header, body content blocks, and prev/next navigation.

Usage

import { CourseDetailPage } from '@leanicon/web-builder-library'

Default

Full layout with sidebar, progress bar, text lesson, and navigation.

2 of 5 lessons completed

Module 1: Getting Started

Your First Component

15 minin progress

In this lesson, you will learn how to create your first React component. We will cover JSX syntax, component structure, and how to render components in the browser.

What is a Component?

A component is a reusable piece of UI that encapsulates its own structure, styling, and behavior.

With image content block

Module 1: Getting Started

Setting Up Your Environment

10 minin progress
Code editor showing React
A typical component file structure

With quiz content block

Module 1: Getting Started

Quiz Lesson

10 minin progress

Lifecycle Quiz

1. Which hook replaces componentDidMount?
2. When does useEffect run by default?

All lessons completed

Progress bar at 100%, completed status badge.

3 of 3 lessons completed

Module 2: Advanced

Final Assessment

30 mincompleted

Congratulations! You have completed all lessons in this course.

Locked lessons

Most lessons locked — only the first is accessible.

0 of 5 lessons completed

Module 1: Getting Started

Welcome

5 minin progress

Welcome to the course! Complete this lesson to unlock the next ones.

Lesson header only (no module name)

Your First Component

15 minin progress

Lesson header — completed status

Module 1: Getting Started

Welcome to the Course

5 mincompleted

Dark mode

2 of 5 lessons completed

Module 1: Getting Started

Your First Component

15 minin progress

In this lesson, you will learn how to create your first React component.

Sub-components

Sub-component

Description

CourseDetailPage.ProgressBar

Progress bar showing completed/total lessons

CourseDetailPage.Sidebar

Accordion sidebar with modules and lesson status icons

CourseDetailPage.Content

Main content wrapper (flex-1)

CourseDetailPage.LessonHeader

Title, module name, duration badge, and status badge

CourseDetailPage.LessonBody

Prose-styled content area

CourseDetailPage.ContentBlock

Renders text (HTML), image, video, or quiz blocks

CourseDetailPage.Navigation

Previous/next lesson navigation

Key Types

CourseModule: { id, title, lessons: Lesson[] }

Lesson: { id, title, duration?, status: LessonStatus, contentBlocks?: ContentBlock[] }

LessonStatus: "completed" | "in-progress" | "not-started" | "locked"

ContentBlock: TextBlock | ImageBlock | VideoBlock | QuizBlock

LessonNavTarget: { id, title, href? }

Notes

  • CourseDetailPage.Sidebar has a mobile-responsive collapsible toggle on small screens.
  • CourseDetailPage.ContentBlock renders text (via dangerouslySetInnerHTML), image with optional caption, video with controls, or quiz with default read-only rendering.
  • Pass children to ContentBlock (quiz type) to override the default quiz display with a custom interactive form.
  • Navigation links use href for anchor links or onNavigate for SPA-style callbacks.
  • Dark mode: pass colorScheme="dark" to the root or place inside a .dark ancestor.

Props

NameTypeDefaultRequiredDescription
colorSchemeenum—No
classNamestring—No
modulesCourseModule[]—Yes
activeLessonIdstring—No
onLessonClick((lessonId: string) => void)—No
titlestring—Yes
modulestring—No
durationstring—No
statusenum—No
headingLevelenumh1Noh1 when the layout IS the page surface (default); h2 when embedded under a page h1 (spec 007 D7).
blockContentBlock—Yes
previousLessonNavTarget—No
nextLessonNavTarget—No
onNavigate((lessonId: string) => void)—No