Docs

Component API Reference

This guide outlines the primary reusable components in the learning platform and the props each one expects. Use it as a quick reference when composing new views or extending existing pages.

MetadataCard

Source: app/components/cards/MetadataCard.tsx

PropTypeDescription
metadataPageMetadataContent metadata including title, description, learning objectives, keywords, author, date, pageId, and team.
Example Usage
import MetadataCard from '@/app/components/cards/MetadataCard';

<MetadataCard
  metadata={{
    title: 'Module 1: Foundations',
    description: 'Introductory context for the case study.',
    learningObjectives: ['Understand key stakeholders'],
    coreConcepts: ['Economics vs Control'],
    keywords: [{ term: 'IP', definition: 'Intellectual Property' }],
    author: 'Course Author',
    date: '2025-10-18',
  }}
/>

ContentCard

Source: app/components/cards/ContentCard.tsx

PropTypeDescription
chunkContentChunkStructured content chunk containing id, heading, html, order, and isKeyConcept.

Key concept chunks render with a warning accent, chip, and border.

The card uses MarkdownContent to render the supplied HTML.

Example Usage
import ContentCard from '@/app/components/cards/ContentCard';

<ContentCard
  chunk={{
    id: 'economics-control',
    heading: 'Economics vs Control',
    order: 1,
    isKeyConcept: true,
    html: '<p>Founders must balance valuation and governance.</p>',
  }}
/>

InstructorNoteCard

Source: app/components/cards/InstructorNoteCard.tsx

PropTypeDescription
titlestringHeading displayed at the top of the card.
htmlstringRendered instructor note markup.

Instructor notes are only visible when instructor mode is enabled via InstructorModeContext.

Example Usage
import InstructorNoteCard from '@/app/components/cards/InstructorNoteCard';

<InstructorNoteCard
  title="Facilitator Notes"
  html="<p>Prompt the class to identify leverage points.</p>"
/>

ModuleNav

Source: app/components/ModuleNav.tsx

PropTypeDescription
moduleIdstringIdentifier for the module (used to build URLs).
activeSlugstringCurrent page slug; applied to highlight the active list item.
pagesModulePageSummary[]Ordered list of pages used for navigation labels.
completedSlugs (optional)string[]Slugs the user has completed; shows check icons.
percentComplete (optional)numberCompletion percentage for the module progress bar.
lastVisitedSlug (optional)stringMost recent slug visited; displays a caption marker.

ModulePageContent

Source: app/components/ModulePageContent.tsx

PropTypeDescription
metadataPageMetadataPage metadata displayed in the header and metadata card.
chunksContentChunk[]Ordered content chunks for the body of the module page.
instructorNote (optional)InstructorNoteHTML notes shown when instructor mode is active.
tableOfContentsTableOfContentsItem[]Section anchors shown in the sticky TOC column.
progressStatus'idle' | 'loading' | 'unauthenticated' | 'ready' | 'error'Current progress hook state.
progressError (optional)stringError message surfaced by the progress hook.
isCompletedbooleanIndicates whether the current page is marked complete.
isProcessingProgressbooleanTrue while a progress mutation is in flight.
onMarkComplete() => void | Promise<void>Handler invoked when the user clicks “Mark as complete.”

The component consumes InstructorModeContext to control visibility of instructor content and exposes a “Mark as complete” action connected to Supabase progress tracking.


MarkdownContent

Source: app/components/MarkdownContent.tsx

PropTypeDescription
htmlstringSanitized HTML produced by the markdown pipeline.

Applies typography, table, blockquote, key concept, and code styling across rendered markdown.

Tables are responsive with zebra striping and overflow scrolling for smaller screens.


For additional integration notes, see the inline comments within each component and the Supabase integration guide maintained in `supabase.md`.