Back to elements
ElementNavigationFree

Dot Pager Indicator React component

Dots that show where you are in a carousel or onboarding flow: the active dot stretches into a pill, a progress style fills the pill and moves on by itself like stories, and a window style shows five dots out of many and shrinks the edge ones. Clickable and keyboard friendly.

When to use the Dot Pager Indicator component

Use Dot Pager Indicator under carousels, onboarding flows, stories and image galleries to show position and let people jump between pages.

For numbered steps with titles, use Stepper or Vertical Progress Steps; for long lists of pages, use Pagination.

Installation

Add the Dot Pager Indicator component to your project with the shadcn CLI. It lands in components/dot-pager-indicator.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/dot-pager-indicator

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Props

<DotPagerIndicator /> accepts 13 props (required ones are marked *).

  • count*
    number
  • value

    Zero-based index of the current page.

    number
  • defaultValue
    number
    Default: 0
  • onValueChange
    (index: number) => void
  • variant

    pill: the active dot stretches into a pill. progress: the active pill fills over `duration` ms, then moves on by itself. window: for many pages, shows `visible` dots and shrinks the ones at the edges.

    "pill" | "progress" | "window"
    Default: "pill"
  • duration

    progress: time per page in ms.

    number
    Default: 4000
  • paused

    progress: pause autoplay (e.g. while the pointer is over the carousel).

    boolean
    Default: false
  • visible

    window: how many dots to show at once.

    number
    Default: 5
  • size
    "sm" | "md" | "lg"
    Default: "md"
  • interactive

    Clicking a dot jumps to that page. Off: a read-only indicator.

    boolean
    Default: true
  • label
    string
    Default: "Slides"
  • theme
    "dark" | "light"
    Default: "dark"
Show all 13 props
  • className
    string

FAQ

Which variant should I use?
pill for a handful of pages, progress when slides advance by themselves (stories, hero rotators), window when there are more pages than dots should show.
Is it accessible?
Interactive dots are buttons named 'Go to slide n' with aria-current on the active one and arrow-key, Home and End support. Read-only mode announces 'n of count' instead.
Can autoplay pause?
Pass paused (for example while the pointer is over the carousel). Reduced-motion users never get autoplay.

Related components

Vertical Progress Steps
Free
Side Tab Menu
Free
Language Switcher
Free
Scrollspy Anchor Links
Free
Timeline
Free
Tree View
Free