Skip to content

Carousel

A horizontally scrolling, snapping track. Swipe, trackpad and keyboard; optional arrows and dots.

CSS + mian.js JSON Markdown Registry item

With controls

Installation

Everything ships in one stylesheet and one small script. There is nothing to import per component.

<link rel="stylesheet" href="https://mian.ro/dist/mian.css">
<script src="https://mian.ro/dist/mian.js" defer></script>

Prefer to own the files? /r/carousel.json is a registry item with this component's CSS and example markup, ready to copy into your project with any tool that reads the open registry-item format.

Class reference

Class / attributeDescription
mn-carouselWrapper.
mn-carousel-track · mn-carousel-itemScroll-snap track and slides.
mn-carousel-prev · mn-carousel-next · mn-carousel-dotsControls; dots are generated if empty.
mn-carousel-peek · mn-carousel-multiShow a peek of the next slide · three per view.

Accessibility

  • The track is a focusable region; arrow keys move one slide. Each slide is labelled "n of N". Nothing auto-advances.
Choose a noodle

Minimal

Flat

Pixel

Linear

Thin

Glass

Textured

Bold

Elegant

Rounded

On this page