Skip to content

WhyThis

Generated from front/ui/catalogue/examples/WhyThis.json

learning · static (no JavaScript) · no children. All components: component playground.

A collapsed ‘Why am I seeing this?’ disclosure listing the plain-text reasons something was shown to the learner. Filled by the app; authors do not place it.

Rendered from the example props below with the real component. Theme: coffee · oncall · nightsky · gravity · poland · ulam · platform · open on its own

{
"component": "WhyThis",
"props": {
"reasons": [
"You answered this question wrongly 2 times",
"This part of the course has been hard for other learners too"
]
}
}
Prop Type Required Notes
summary string Text of the disclosure; the interface wording of ‘Why am I seeing this?’ when left out. max length 80
reasons array of string yes 1 to 6 reasons. min 1 items, max 6 items
locale "en" | "pl" | "zh" Interface language of the fixed strings; filled by the app, authors and models leave it out
id string Anchor id for in-page links (letters, digits, dashes). max length 40

What a text-only client, an unknown renderer or a plain-text channel shows for the example above.

Why am I seeing this?
- You answered this question wrongly 2 times
- This part of the course has been hard for other learners too

A node whose props fail the schema never breaks the page: the renderer shows the plain-text fallback instead (and logs the issues in development).

{
"reasons": []
}

Issues:

  • /reasons fewer than 1 items

Rendered as:

Why am I seeing this?

axe-core: 6 rules passed, 0 violations, 0 need manual review. Run at build time on the server-rendered HTML in jsdom. Colour contrast and layout rules need a browser and are covered by the Playwright axe scans of the reference frontend.