Skip to Content
📧 Join the Teacharium waitlist to get access. 

Fields

fields describe the settings panel authors use in the lesson editor. Each key is a prop name; the stored value is passed to your render function.

fields: { title: { type: "text", label: "Title" }, level: { type: "select", label: "Level", options: [ { label: "Easy", value: "easy" }, { label: "Hard", value: "hard" }, ], }, }

Keep stored values JSON-serializable: lessons save props as JSON, and they’re exported into SCORM packages and the self-hosted player.

Puck fields

All Puck field types  work:

TypeStoresNotes
textstring
textareastring
numbernumbermin, max, step
selectany option valueoptions: [{ label, value }]
radioany option valueUse for booleans: [{label:"Yes",value:true},{label:"No",value:false}]
arrayarray of objectsarrayFields, defaultItemProps, getItemSummary
objectobjectobjectFields
slotnested componentsLets authors drop other components (for example Text) inside yours
customanythingYour own field UI via render

Teacharium fields

These field types are provided by the Teacharium editor:

TypeStoresRead it with
variablea variable nameapi.hooks.useVariableValues([name]), api.updateVariables({ [name]: value })
numericExpressionan expression string, such as {{score}} * 2api.hooks.useNumberExpressions([expr], [fallback])
stringExpressiona template string, such as Hi {{name}}api.hooks.useStringExpressions([expr])
condition{ expression: "{{score}} >= 80" }api.hooks.useConditionEvaluation(condition)
imageMediaa media library referenceapi.hooks.useResolvedMediaUrl(value)
audioMediaa media library referenceapi.hooks.useResolvedMediaUrl(value)
videoMediaa video library referenceapi.hooks.useResolvedVideoUrls(value) (HLS, MP4, thumbnail)
voiceover{ enabled, voice, content, contentHash, showPlayButton }api.hooks.useResolvedVoiceoverUrl(contentHash, voice) and <AudioPlayer> from @teacharium/widget
actiona list of { actionType, parameters }executeActions(api, actions) from @teacharium/widget
stepa step idEmit { type: "goToStep", params: { targetStepId } }
colora CSS color string
svgSourceraw SVG markup (may contain {{variables}})Resolve with useStringExpressions(..., { escapeHtml: true }) and sanitize before rendering
placeholdernothingShows description as help text in the panel

Prefer expression fields (numericExpression, stringExpression) over plain number/text when a value might reasonably depend on a variable: authors can still type a constant, and lessons can make it dynamic later.

Changing fields after publishing

Lessons keep the props they were saved with. When you change fields in a new version:

  • Adding a field is safe; give render a default for lessons that don’t have it yet.
  • Never rename or repurpose a prop. Add a new one and keep reading the old one.
  • Removing a field just hides it from authors; old lessons still pass the value.