Light themes
Dark themes

Make your own

Accordion

An accordion is a list of questions that open one at a time: hairline rows, a bold question, a plus tile that turns into a cross.

What does it taste like?

Mild and earthy, with mushroom and herbal notes, and less salty than sturgeon caviar. The eggs are firm and pop on the tongue.

How long does a jar keep?

Unopened, up to three months in the fridge. Once opened, eat it within three days.

How is it delivered?

By courier in a chilled box, the same day in the city, or you collect it at the farm shop.

Delivery

Courier, chilled box, 14:00 to 18:00.

Payment

Card, on delivery.

Playground

Three questions on the browser's own details: the first one is yours to write, open or closed, one at a time or several.

HTML

Markup

HTML
<div class="tray-accordion">
  <details name="faq" open>
    <summary>What does it taste like? <span class="tray-tile" aria-hidden="true">…plus icon…</span></summary>
    <p class="tray-accordion__body">Mild and earthy…</p>
  </details>
</div>

It is the browser's own <details>: no script, searchable with find-in-page, open by default where you set open. Give the details the same name to let only one be open at a time; leave name out to let several stay open.

tray-accordion sets questions in subtitle; tray-accordion--sm sets them in control for settings and filters. Answers are ink-soft and at most 60 characters wide.

Accessibility

It is the browser's own <details>: Tab reaches each question, Enter or Space opens and closes it, and screen readers announce it as expanded or collapsed. The question in <summary> is its name; the plus tile is aria-hidden. The question takes the 3px ink focus ring. Under prefers-reduced-motion: reduce the answer opens at once instead of unfolding.

Do and don't

  • Do write the summary as the question a person would ask.
  • Do open the first item when the answers are the point of the page.
  • Don't hide anything a person must read to finish a task.
  • Don't nest accordions.
↑↓ to moveEnter to openEsc to close