Skip to content
v0.9.1
Components

Carousel

Slides in a row that snap into place. Swipe on a phone, scroll with a trackpad, press the arrows or the dots, or use the arrow keys. It is a scrolling row underneath, so it works (as a swipeable row) even without JavaScript.

Carousel

<div class="carousel" aria-label="Landscapes">
  <div class="carousel-track">
    <div class="carousel-slide"><div class="carousel-card"><img src="../examples/img/sample-1.svg" alt="Yellow hills at noon"><div class="carousel-caption"><b>Yellow hills</b>At noon, in summer</div></div></div>
    <div class="carousel-slide"><div class="carousel-card"><img src="../examples/img/sample-2.svg" alt="Violet dusk over the hills"><div class="carousel-caption"><b>Violet dusk</b>Just after sunset</div></div></div>
    <div class="carousel-slide"><div class="carousel-card"><img src="../examples/img/sample-3.svg" alt="A green valley"><div class="carousel-caption"><b>Green valley</b>A spring morning</div></div></div>
    <div class="carousel-slide"><div class="carousel-card"><img src="../examples/img/sample-4.svg" alt="Pink sunrise over the sea"><div class="carousel-caption"><b>Pink sunrise</b>Over a calm sea</div></div></div>
  </div>
  <button class="carousel-prev" type="button" aria-label="Previous"><i class="mi mi-chevron-left" aria-hidden="true"></i></button>
  <button class="carousel-next" type="button" aria-label="Next"><i class="mi mi-chevron-right" aria-hidden="true"></i></button>
  <div class="carousel-dots"></div>
</div>

Several at a time

Set --slide-size to a width: here each card is 256px and as many as fit show at once; the arrows move a page at a time. .carousel-arrows-below puts the arrows under the row.

<div class="carousel carousel-arrows-below" style="--slide-size: 16rem" aria-label="Templates">
  <div class="carousel-track">
    <div class="carousel-slide"><div class="card h-full"><img class="card-media aspect-3/2" src="../examples/img/sample-5.svg" alt=""><div class="card-body"><h3 class="card-title">Lake</h3><p class="card-text text-muted">A calm landing page</p></div></div></div>
    <div class="carousel-slide"><div class="card h-full"><img class="card-media aspect-3/2" src="../examples/img/sample-6.svg" alt=""><div class="card-body"><h3 class="card-title">Desert</h3><p class="card-text text-muted">Warm and simple</p></div></div></div>
    <div class="carousel-slide"><div class="card h-full"><img class="card-media aspect-3/2" src="../examples/img/sample-7.svg" alt=""><div class="card-body"><h3 class="card-title">Night</h3><p class="card-text text-muted">Dark from the start</p></div></div></div>
    <div class="carousel-slide"><div class="card h-full"><img class="card-media aspect-3/2" src="../examples/img/sample-8.svg" alt=""><div class="card-body"><h3 class="card-title">Town</h3><p class="card-text text-muted">For a local shop</p></div></div></div>
    <div class="carousel-slide"><div class="card h-full"><img class="card-media aspect-3/2" src="../examples/img/sample-2.svg" alt=""><div class="card-body"><h3 class="card-title">Dusk</h3><p class="card-text text-muted">A portfolio</p></div></div></div>
    <div class="carousel-slide"><div class="card h-full"><img class="card-media aspect-3/2" src="../examples/img/sample-3.svg" alt=""><div class="card-body"><h3 class="card-title">Valley</h3><p class="card-text text-muted">A blog</p></div></div></div>
  </div>
  <div class="carousel-dots"></div>
  <button class="carousel-prev" type="button" aria-label="Previous"><i class="mi mi-chevron-left" aria-hidden="true"></i></button>
  <button class="carousel-next" type="button" aria-label="Next"><i class="mi mi-chevron-right" aria-hidden="true"></i></button>
</div>

Playing by itself

data-momo-autoplay="4000" moves on every 4 seconds and loops. A pause button appears in the corner; it also pauses while the pointer is over it or focus is inside, and never plays for readers who prefer less motion. .carousel-center snaps slides to the middle, and an 85% slide size lets the next one peek in.

<div class="carousel carousel-center" style="--slide-size: 85%" data-momo-autoplay="4000" aria-label="Highlights">
  <div class="carousel-track">
    <div class="carousel-slide"><img src="../examples/img/sample-7.svg" alt="Night hills under the moon" class="aspect-21/9"></div>
    <div class="carousel-slide"><img src="../examples/img/sample-8.svg" alt="A small town at dusk" class="aspect-21/9"></div>
    <div class="carousel-slide"><img src="../examples/img/sample-5.svg" alt="A blue lake between mountains" class="aspect-21/9"></div>
  </div>
  <div class="carousel-dots"></div>
</div>

Crossfade

.carousel-fade shows one slide at a time and fades to the next in place: a banner on top of a page, a quote that changes. Arrows, dots, arrow keys, swiping and autoplay all work the same.

<div class="carousel carousel-fade" aria-label="Seasons" data-momo-loop id="cr-fade" style="max-width: 36rem">
  <div class="carousel-track">
    <div class="carousel-slide is-active"><div class="carousel-card"><img src="../examples/img/sample-1.svg" alt="Yellow hills at noon"><div class="carousel-caption"><b>Summer</b>Long days in the hills</div></div></div>
    <div class="carousel-slide"><div class="carousel-card"><img src="../examples/img/sample-6.svg" alt="An orange desert"><div class="carousel-caption"><b>Autumn</b>Warm light, long shadows</div></div></div>
    <div class="carousel-slide"><div class="carousel-card"><img src="../examples/img/sample-7.svg" alt="Night hills under the moon"><div class="carousel-caption"><b>Winter</b>Early nights</div></div></div>
  </div>
  <button class="carousel-prev" aria-label="Previous"><i class="mi mi-chevron-left"></i></button>
  <button class="carousel-next" aria-label="Next"><i class="mi mi-chevron-right"></i></button>
  <div class="carousel-dots"></div>
</div>

Classes and options

Class / attributeDoes
.carousel / .carousel-track / .carousel-slideThe carousel, the scrolling row, one slide
--slide-sizeSlide width: 100% (one at a time, the default), 85% to peek, or a size like 16rem
--carousel-gapSpace between slides (16px)
.carousel-prev / .carousel-nextArrow buttons (hidden at the ends unless it loops)
.carousel-dotsAn empty box; Momo fills it with one dot per stop
.carousel-card + .carousel-captionA picture slide with a caption box over it (--slide-ratio, 16:9)
.carousel-center / .carousel-arrows-belowSnap to the middle / arrows under the row
data-momo-loopThe arrows wrap around from the last slide to the first
data-momo-autoplay="ms"Moves on by itself, with a pause button

From script: Momo.carousel.go('#my-carousel', 2) jumps to the third slide.

Accessibility

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close