Malevich

Blocks/

Accordion

Native

stack. Independent items.

Accordion

A vertically-stacked set of collapsible sections. Built on native <details>/<summary> for keyboard, focus, and screen reader behavior out of the box. CSS-only — no JavaScript, no runtime.

When to use

Use an accordion to let users disclose related content on demand: FAQs, documentation sections, settings groups. Each section is independent — opening one does not close another. This matches the HTML standard and avoids the "where did my content go?" surprise that single-open accordions can cause when scroll position shifts.

If you need single-open behavior, add a small piece of JavaScript that listens to toggle events on the items and closes siblings. The component does not ship this behavior because most patterns do not need it and the surprise factor is real.

Variants

Variant Class Use for
Default .accordion Card-style group with border and bg
Flush .accordion.-flush No outer border, item separators only

Anatomy

<section class="accordion">
  <details class="accordion__item">
    <summary class="accordion__summary">What is Malevich?</summary>
    <div class="accordion__body">
      A semantic design system rooted in suprematism, built for humans
      and AI agents.
    </div>
  </details>

  <details class="accordion__item" open>
    <summary class="accordion__summary">Why semantic-first?</summary>
    <div class="accordion__body">
      Standard HTML elements carry meaning that custom elements do not.
      Native semantics work across browsers and assistive technology
      without component-specific shims.
    </div>
  </details>
</section>

Add open on <details> to render expanded by default.

Tokens used

From semantic tier

Accessibility

Native <details>/<summary> carries all required semantics:

The native disclosure marker is removed via list-style: none and the ::-webkit-details-marker and ::marker pseudo-elements. A custom chevron renders via a CSS mask and rotates 180° when the item is open. The rotation honors prefers-reduced-motion.

Edge cases

Do

Don't