Accordion

Blocks that open and close. Built on details and summary, so it works without JavaScript.

Edit page

Example

Is Avior free?

Yes. It is open source under the MIT licence, for personal and client work.

Does it need a backend?

No. The build is a folder of static files for any host.

Can I use it with an AI agent?

Yes. AGENTS.md tells the agent how the system is meant to be used.

Example.jsx
import { Accordion } from './components/Accordion'

<Accordion items={[
  { title: 'Is it free?', body: <p>Yes, under the MIT licence.</p>, open: true },
  { title: 'Does it need a backend?', body: <p>No.</p> },
]} />

Markup

The component writes plain HTML. Without React it is the same markup:

Is Avior free?

Yes.

index.html
<div class="accordion">
  <details class="accordion-item" open>
    <summary class="accordion-head">Is Avior free?</summary>
    <div class="accordion-body">Yes.</div>
  </details>
</div>

Parts

ClassWhat it is
accordiona column of items with a gap
accordion-itemone details element, bordered
accordion-headthe summary: the question and the arrow
accordion-bodythe answer, muted

Variables

VariableDefaultWhat it sets
$accordion-gap8pxspace between items
$accordion-padding16px 20pxpadding of the head
$accordion-radius12pxcorner radius
$accordion-linevar(--line)border colour
$accordion-backgroundvar(--page)background