Accordion

A little less noise. Expandable sections for the details that matter.

Installation

Run the source CLI from a Blocks UI checkout. This package is not published to npm.

node packages/cli/index.js add accordion

Or copy the source files above. Include tokens.css and base.css once in your project.

Usage

Use the authored row-and-column structure, then let the standalone runtime discover and enhance the block.

<div class="accordion">
  <div><div>What is Blocks UI?</div><div>An open collection of accessible components and website blocks built with HTML, CSS, and JavaScript.</div></div>
  <div><div>Do I need a framework?</div><div>No React, no Vue, no framework required. Just the web platform.</div></div>
  <div><div>Can I use it with AEM?</div><div>Yes. Blocks preserve the EDS row-and-column markup and default decorate function contract. Live AEM integration is not yet verified.</div></div>
  <div><div>Do I own the code?</div><div>Yes. Copy the files into your project and customize them directly.</div></div>
</div>
import decorate from './blocks/accordion/accordion.js';
document.querySelectorAll('.accordion').forEach(decorate);

Variants

Choose a variant in the live preview. Add its class to the authored block.

defaultbordered

Accessibility & behavior

Native details and summary elements support Enter and Space. Content remains visible in authored HTML when JavaScript is unavailable.

Multiple instances are supported. Layouts adapt to smaller viewports. No npm dependencies are required at runtime.

AEM usage

Copy the canonical CSS and JavaScript into your EDS block folder. Use the same row-and-column authoring structure shown above and let your existing AEM loader call the default decorator.

Compatibility

Standalone verified. EDS markup compatible. Live AEM integration has not been verified.

Edit this example on GitHub

Search documentation

Search the docs, components, and blocks. Use Tab to select a result.