Chart

H5P equivalent

H5P Chart

When to use

Use Chart to visualize simple metrics — incident counts, survey breakdowns, or category comparisons. Supports bar and pie; empty data falls back gracefully.

Try it

Documentation demo

Use the Live demo, React, AI prompt, and Packaging / Manifest tabs below. Embedded demos disable telemetry, xAPI, and the LMS bridge. For production delivery, use the CLI template src/courseConfig.ts and LMS Go-Live.

<Chart
  blockId="incidents-chart"
  type="bar"
  title="Reported incidents — Q1"
  data={[
    { label: "Phishing", value: 42 },
    { label: "Malware", value: 11 },
    { label: "Lost device", value: 4 },
  ]}
/>

Copy into Cursor, Copilot, or ChatGPT after the vibe coding starter context:

Read lessonkit.json and src/App.tsx before editing.

Add a Chart block (H5P-style: Chart) like this example inside the active <Lesson>:

<Chart
  blockId="incidents-chart"
  type="bar"
  title="Reported incidents — Q1"
  data={[
    { label: "Phishing", value: 42 },
    { label: "Malware", value: 11 },
    { label: "Lost device", value: 4 },
  ]}
/>

Requirements:
- Import only from @lessonkit/react; use block types from block-catalog.v3.json.
- Keep existing courseId, lessonId, and navigation stable unless I ask to add a lesson.
- After edits, list changed files and what to verify in the browser (lessonkit dev).

Workflow tips: https://lessonkit.readthedocs.io/en/latest/guides/vibe-coding/prompting-and-workflows.html

See also