Dot Pagination

Minimal carousel dot indicators with an active pill state for slide navigation.

Tailwind CSS
<div class="flex items-center justify-center gap-2">
  <button aria-label="Go to slide 1" class="w-2 h-2 rounded-full bg-slate-300 hover:bg-slate-400 transition"></button>
  <button aria-label="Go to slide 2" class="w-2 h-2 rounded-full bg-slate-300 hover:bg-slate-400 transition"></button>
  <button aria-label="Go to slide 3" aria-current="true" class="w-7 h-2 rounded-full bg-slate-900 transition-all"></button>
  <button aria-label="Go to slide 4" class="w-2 h-2 rounded-full bg-slate-300 hover:bg-slate-400 transition"></button>
  <button aria-label="Go to slide 5" class="w-2 h-2 rounded-full bg-slate-300 hover:bg-slate-400 transition"></button>
</div>

Free to use in personal and commercial projects. No attribution required.

Variants

Same component, different looks. Preview each one live and copy the code you like.

Numbered

Numbered dots help when users need to know exactly which slide they are on.

Tailwind CSS

Large

The large touch-friendly dots suit mobile carousels and onboarding screens.

Tailwind CSS

On dark

The on-dark version keeps dots visible over hero images and video backgrounds.

Tailwind CSS

About this dot pagination

Dots are the quietest form of carousel navigation. Five small indicators, with the active one stretched into a pill, tell users where they are and how many slides exist without stealing attention from the content itself. They are the pattern behind most hero sliders, testimonial rotators, and onboarding flows.

The markup is a flex row of round buttons with a small gap. Inactive dots stay tiny slate circles, while the active dot carries aria-current plus a wider w-7 width and a dark fill. Because width changes are transitioned, the pill stretches smoothly as the active index moves.

Use dots when your slides are peer content where exact position matters less than progress, like hero banners or quotes. Keep them to about five to seven at most. Past that they crowd together, and a numbered pagination or a thin progress bar communicates better.

Carousels need position awareness without stealing attention from the slides themselves. Numbered pagination shouts, arrows demand interpretation, but five small dots whisper you are on two of five and get out of the way. It is the right control for hero sliders, testimonial rotators, and onboarding flows where the content is the star.

The markup is a flex row of round buttons with a small gap. Inactive dots stay tiny slate circles while the active dot carries aria-current plus a wider w-7 width and a dark fill, stretching into a pill. Because the width change is transitioned, the pill stretches smoothly instead of popping, and each dot is a real button with a Go to slide N label.

Expand each dot's hit area to 24px with transparent padding while keeping the visual dot at 8px; nobody can reliably tap an 8px target. On swipeable carousels, make the dots draggable as a scrubber on desktop, where precise clicking matters more than on touch. Dim inactive dots to 30% opacity instead of shrinking them; size changes make the row jitter as you navigate. When there are more than 8 slides, switch to a fraction readout; a dozen dots is a barcode, not navigation.

Autoplay with no pause control is the accessibility failure: the slides keep rotating while the user reads, yanking the content away mid-sentence. Dots alone cannot fix this; every auto-rotating carousel needs a visible pause button and must stop on hover and focus. Motion the user cannot stop is not a feature, it is a WCAG violation.

Where to use it

  • ✓ Hero image carousels on landing pages
  • ✓ Testimonial sliders with multiple quotes
  • ✓ Onboarding step indicators in apps
  • ✓ Product image galleries on detail pages

Customization tips

Change w-7 to w-5 or w-9 to tune the active pill length, and swap bg-slate-900 for your brand color. On dark backgrounds, use white dots with reduced opacity for the inactive states so the active one still pops.

Design notes

When to use

Use dot pagination when a carousel has a small, countable set of slides, like a product gallery with five photos or a testimonial rotator, because the dots quietly tell visitors where they are and how much is left. The stretched active pill makes the current position readable at a glance without shouting over the content. It fits carousels where swiping or arrow clicks are the main interaction and the dots are just orientation.

What to avoid

Do not use dots alone on carousels with ten or more slides, because a row of identical dots stops communicating position and becomes visual noise. Do not make the dots the only control on long carousels either, since clicking through eight dots one by one is tedious. And keep the dots big enough to tap, because tiny dots on a phone are decoration, not navigation.

Accessibility

Render each dot as a real button with an aria-label like Go to slide 3, and mark the current one with aria-current so screen readers announce the position. Keyboard users should be able to tab to the dots and activate them with Enter.

Frequently asked questions

How do I make the dots clickable to jump to a slide?

Each dot is already a button, so attach a click handler that sets the carousel index. Move the wide active classes and the aria-current attribute to the newly active dot in the same update.

What if my carousel has more than 7 slides?

Dots stop working past about seven because they wrap or crowd. Switch to numbered pagination, or show a compact counter like 2 / 12 next to prev and next arrows.

Should the dots update when the carousel auto-advances?

Yes. Whenever the slide changes, by timer, swipe, or arrow, update the active dot in the same render. An indicator that disagrees with the visible slide confuses users fast.

How do I make the active dot larger than the rest?

Transition the active dot's width from a circle to a pill, for example 8px to 24px, while keeping the height constant. Mark it with aria-current true so the state is exposed to assistive tech. This stretched-dot style is popular because it reads as progress, not just position.

How big should carousel dots be on touch screens?

Make the tap target at least 44 by 44 pixels even if the visible dot is only 8px, using padding or a pseudo element to expand the hit area. Space the targets with a gap of at least 8px so fat-finger taps do not hit two dots. Test on a real phone, devtools touch emulation hides sizing problems.

Should I use dots or thumbnails for carousel navigation?

Use dots when slides are similar or the count is high, they stay compact and scannable. Use thumbnails when each slide is visually distinct and users pick by content, like product photos. Beyond about seven slides, dots get fiddly, so consider numbered pagination or arrows instead.