Carousel

One story at a time. Scrollable slides with explicit, accessible controls.

Installation

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

node packages/cli/index.js add carousel

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="carousel">
  <div><div><span class="badge">HTML</span><h2>Start with content.</h2><p>Semantic markup is the foundation, not a compilation target.</p></div></div>
  <div><div><span class="badge">CSS</span><h2>A shared visual language.</h2><p>Design tokens keep every block consistent, with room to make it yours.</p></div></div>
  <div><div><span class="badge">JavaScript</span><h2>Enhance, don't replace.</h2><p>Small modules add interactions while preserving your authored content.</p></div></div>
</div>
import decorate from './blocks/carousel/carousel.js';
document.querySelectorAll('.carousel').forEach(decorate);

Variants

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

default

Accessibility & behavior

No autoplay. Previous and Next buttons announce the selected slide. The track is keyboard scrollable and respects reduced-motion preferences.

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.