01 · Native carousel

Native carousel

Carousel with scroll markers and scroll buttons

scroll-snap today · ::scroll-button/::scroll-marker experimental (Chrome 135+ flag)
← Index

Drag or use the arrows/dots. In browsers without support you still get a fully usable horizontal scroll.

css
.carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-marker-group: after;   /* dots nativos */
}

.carousel .card {
  scroll-snap-align: start;     /* cada card hace snap */
  width: 280px;
}

/* flechas nativas — el navegador las deshabilita solo */
.carousel::scroll-button(left)  { content: "‹"; }
.carousel::scroll-button(right) { content: "›"; }

/* dots nativos — :target-current marca el activo */
.carousel::scroll-marker { width: 10px; height: 10px; }
.carousel::scroll-marker:target-current {
  background: var(--amber-500);
  transform: scale(1.3);
}

An honest note on support

Many of these APIs are recent and not yet in every browser (see the pill on each section). The nice part is they all degrade gracefully: the carousel still scrolls, the accordion opens/closes, the textarea works — just without the animated "plus".