Block catalog reference¶
Runtime block catalog (v1)¶
H5P equivalents
Many LessonKit blocks mirror H5P content types as native React components (not embedded H5P). Quiz = H5P Multiple Choice; Tier B P0 question types ship in Catalog v2 (framework 1.1.0). Full mapping: H5P capability map · guide: Coming from H5P?.
The block catalog describes every framework-owned learning primitive in @lessonkit/react. Use it to validate generated code, document supported props, and align Studio/AI workflows with the same runtime components authors use today.
H5P names for v1 blocks¶
LessonKit block |
H5P display name |
H5P machine name (typical) |
|---|---|---|
|
Multiple Choice |
|
|
(scenario / content area) |
— |
|
(open text / reflection) |
— |
|
(course structure) |
— |
|
(progress UI) |
— |
Catalog artifacts¶
Artifact |
Path |
|---|---|
Version |
|
JSON |
|
JSON Schema |
|
Programmatic API |
|
Import in Node or bundlers:
import catalog from "@lessonkit/react/block-catalog.v1.json" assert { type: "json" };
// catalog.schemaVersion === 1
// catalog.entries — one object per block type
Block types (v1)¶
Type |
Category |
Required IDs |
Telemetry |
|---|---|---|---|
|
container |
|
|
|
container |
|
|
|
content |
optional |
manual |
|
content |
optional |
manual |
|
assessment |
|
|
|
assessment |
(alias of |
same as |
|
chrome |
— |
none |
Composition rules¶
ThemeProvider
└── Course (courseId)
├── ProgressTracker
└── Lesson (lessonId)
├── Scenario (blockId?)
├── Reflection (blockId?)
├── Quiz / KnowledgeCheck (checkId)
└── custom UI + useTracking()
Quiz/KnowledgeCheckmust be inside an activeLessonfor quiz telemetry (lessonIdrequired).Scenario/Reflection: setblockIdwhen you want block-level URNs oninteractionevents (see Telemetry reference).ProgressTrackerreads runtime progress; place insideCourse.
Per-block contracts¶
Course¶
Prop |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Course title (h1) |
|
CourseId |
yes |
Stable course id |
|
LessonkitConfig (minus courseId) |
no |
Tracking, xAPI, session |
|
ReactNode |
yes |
Lessons and chrome |
A11y: <section aria-label={title}>, <h1>.
Theming: Inherits --lk-* from ThemeProvider.
Telemetry: Provider emits course_started on mount; completeCourse() emits course_completed.
Lesson¶
Prop |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Lesson title (h2) |
|
LessonId |
yes |
Stable lesson id |
|
ReactNode |
yes |
Blocks and content |
A11y: <article aria-label={title}>, <h2>.
Theming: Inherits global tokens.
Telemetry: lesson_started on mount; lesson_completed + lesson_time_on_task on unmount or lesson switch.
Scenario¶
Prop |
Type |
Required |
Description |
|---|---|---|---|
|
BlockId |
no |
Block URN segment for interactions |
|
ReactNode |
yes |
Narrative and custom UI |
A11y: <section aria-label="Scenario">.
Theming: data-lk-block-id when blockId set.
Telemetry: No automatic events; use useTracking().track("interaction", …).
Reflection¶
Prop |
Type |
Required |
Description |
|---|---|---|---|
|
BlockId |
no |
Block URN segment |
|
string |
no |
Question above textarea |
|
ReactNode |
no |
Optional content above textarea |
A11y: <section aria-label="Reflection">; textarea uses aria-labelledby or aria-label.
Theming: data-lk-block-id when blockId set.
Telemetry: Manual interaction events (e.g. on submit).
Quiz / KnowledgeCheck¶
Prop |
Type |
Required |
Description |
|---|---|---|---|
|
CheckId |
yes |
Assessment id (sync with |
|
string |
yes |
Question text |
|
string[] |
yes |
Radio options |
|
string |
yes |
Correct choice (must match one option) |
A11y: Fieldset + radios; role="status" aria-live="polite" for feedback; visually hidden legend.
Theming: data-lk-check-id from checkId.
Telemetry: quiz_answered on each choice; quiz_completed on first correct answer.
ProgressTracker¶
No props.
A11y: <aside aria-label="Progress">.
Theming: Inherits global tokens.
Telemetry: None (display-only).
Catalog v2 (framework 1.1.0 — shipped)¶
H5P question types (1.1.0)
These LessonKit blocks are React implementations of common H5P question content types. Each implements the shared Assessment contract (scores, retry, solutions, xAPI)—see SPEC.md.
blockCatalogVersion = 2 adds H5P-aligned assessments under a shared Assessment contract. Full traceability: H5P capability map.
LessonKit block |
H5P display name |
|---|---|
|
True/False |
|
Fill in the Blanks |
|
Drag and Drop |
|
Drag the Words |
|
Mark the Words |
|
Question Set |
Block |
Category |
|
1.1.x tranche |
|---|---|---|---|
|
assessment |
required |
P0 |
|
assessment |
required |
P0 |
|
assessment |
required |
P0 |
|
assessment |
required |
P0 |
|
assessment |
required |
P0 |
|
container |
per child |
P0 |
|
assessment |
required |
existing (contract alignment) |
P0 acceptance (each block): Storybook story, unit tests, catalog JSON entry, telemetry + xAPI mapping, lessonkit.json assessment mapping, export parity e2e.
Not in v2: compound types (InteractiveBook, SlideDeck, …) — see roadmap.
Import @lessonkit/react/block-catalog.v2.json or buildBlockCatalog({ version: 2 }). Use { version: 1 } for legacy generators.
Catalog v3 (framework 1.2.0 — shipped)¶
Default in 1.2.0: buildBlockCatalog() and buildBlockCatalog({ version: 3 }).
Adds content primitives (Text, Heading, Image), compound containers (Page, InteractiveBook), Tier C/D blocks (Accordion, DialogCards, Flashcards, ImageHotspots, ImageSlider, FindHotspot, FindMultipleHotspots), and allowedChildTypes / compoundContract on compound entries.
Block |
H5P display name (typical) |
|---|---|
|
Column / page (Interactive Book chapter) |
|
Interactive Book |
|
Accordion |
|
Dialog Cards |
|
Flashcards |
|
Image Hotspots |
|
Image Slider |
|
Find the Hotspot |
|
Find Multiple Hotspots |
Import @lessonkit/react/block-catalog.v3.json or pin { version: 2 } until generators are updated.
Cross-references¶
H5P mapping: H5P capability map
Identity: Identity reference — id format and URNs (
@lessonkit/core/identity-contract.v1.json)Telemetry events: Telemetry reference — event catalog (
@lessonkit/core/telemetry-catalog.v1.json)Theming: Theming reference — token catalog (
@lessonkit/themes/theme-catalog.v1.json)Accessibility: Accessibility reference
Reference example¶
examples/lxpack-golden renders every catalog block (Course, Lesson, Scenario, Quiz, KnowledgeCheck, Reflection, ProgressTracker) and is the packaging golden path for CI.
Generator checklist¶
Import
@lessonkit/react/block-catalog.v1.jsonand reject unknown block types.Validate required props and IDs per entry (
requiredIds,props).Keep
courseIdand everycheckIdin sync withlessonkit.json. Forsingle-spalayouts, manifestlessons[].idlists LMS shell lesson(s) only; additional in-applessonIds may exist only in React (see Identity).Nest blocks per
parentConstraints(Quiz inside Lesson, etc.).Do not invent Studio-only blocks (
text,heading, …) in framework codegen until they ship in a future runtime catalog version (Studio schema is separate; see H5P capability map).For new assessments, see catalog v2 and implement
checkIdbefore shipping.When shipping an H5P-parity block, complete the H5P documentation checklist (capability map ✅, H5P names here, authors guide, Storybook).