accessible details/summary accordion, no JS required.
Is there a build step?
No — save a file and refresh.
Do I need to learn YAML?
Just a couple of keys.
Can I host it for free?
Any static host works.
Install
From your site folder, run:
jprot add FaqAccordionThat downloads the self-contained component into theme/components/FaqAccordion.js,
where it is picked up automatically — the same way as any built-in component.
To remove it later, just delete that file.
Use it as a homepage section
Add an entry to the sections: list in jprot.config.js:
sections: [
{ component: 'FaqAccordion', title: 'FaqAccordion' },
]Use it inside a page
On its own line in any Markdown file, passing the props:
:::FaqAccordion items='[{"q":"Is there a build step?","a":"No — save a file and refresh."},{"q":"Do I need to learn YAML?","a":"Just a couple of keys."},{"q":"Can I host it for free?","a":"Any static host works."}]'Props
| Prop | Type | Note |
|---|---|---|
items | array | [{ q, a }] |
title | string | optional heading |