# Carousel Dots

> Slide indicator dots where the active one stretches into a pill. Built on radio buttons, so it works with the keyboard.

- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: dots, carousel, slider, indicator, pagination, radio
- Live preview: https://copy-css.com/snippets/carousel-dots
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<div class="carousel-dots" role="radiogroup" aria-label="Slides">
  <input type="radio" name="slide" aria-label="Slide 1" checked>
  <input type="radio" name="slide" aria-label="Slide 2">
  <input type="radio" name="slide" aria-label="Slide 3">
  <input type="radio" name="slide" aria-label="Slide 4">
</div>
```

## CSS

```css
.carousel-dots {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: #f1f5f9;
}

.carousel-dots input {
  width: 10px;
  height: 10px;
  margin: 0;
  border-radius: 999px;
  background: #cbd5e1;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.carousel-dots input:hover {
  background: #94a3b8;
}

.carousel-dots input:checked {
  width: 28px;
  background: #0f172a;
}

.carousel-dots input:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}
```

## Notes

- This CSS Carousel Dots is 33 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, Flexbox, the :checked state (no JavaScript) and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
