WhyThis
Generated from front/ui/catalogue/examples/WhyThis.json
learning · static (no JavaScript) · no children. All components: component playground.
Description for the model
Section titled “Description for the model”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.
Live example
Section titled “Live example”Rendered from the example props below with the real component. Theme: coffee · oncall · nightsky · gravity · poland · ulam · platform · open on its own
Example
Section titled “Example”{ "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 |
Text fallback
Section titled “Text fallback”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 tooInvalid props
Section titled “Invalid props”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:
/reasonsfewer than 1 items
Rendered as:
Why am I seeing this?Accessibility
Section titled “Accessibility”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.