Skip to content

PageIndicator

Dots for the pages of an onboarding flow or gallery; each dot is a 44px target and the current one is wider.

  • Pro, mobile
  • Version 2.0.0-rc.1
  • APG pattern: Radio group

Examples

Still previews of the real component, rendered from its stories. Pro code isn’t public, so nothing in them responds. Switch the theme and density for every preview at once.

Default

Tokens

The 7 design tokens PageIndicator reads, with the value each has in the theme and density chosen above. Change a token and the component follows, in Figma and in code.

Show all 7 tokens
Tokens PageIndicator reads
TokenValue nowCSS variable
color.action.primary…--sd-color-action-primary
color.bg.canvas…--sd-color-bg-canvas
color.bg.muted…--sd-color-bg-muted
color.border.strong…--sd-color-border-strong
motion.duration.fast…--sd-motion-duration-fast
radius.full…--sd-radius-full
target.min…--sd-target-min

Install

Pro components come as source from the SuperDuper registry, with a licence key from Solo, Team or Studio. The registry and checkout aren’t open yet.

Add it from the registry (Pro licence key)

npx shadcn@latest add @superduperui/page-indicator

Then import it

import { PageIndicator } from "@/components/ui/page-indicator"

Props

PageIndicator props
PropTypeWhat it does
countrequirednumberNumber of pages.
pagerequirednumberCurrent page, 0-based.
onPageChange(page: number) => void
aria-labelstringDefault 'Pages'Names the group. Default "Pages".
pageLabel(index: number, count: number) => stringDefault (i, n) => `Page ${i} of ${n}`Name of each dot. Default "Page i of n".
classNamestring

When to use it

Use it for

  • Onboarding pages, image galleries

Use something else for

  • Long lists: use Pagination
  • Progress through a task: use Steps

Accessibility

Screen readers announce "Pages, radio group" then "Page 2 of 4, radio button, checked".

WCAG 2.2 AAA criteria the component meets in Comfortable density: 1.4.6, 1.4.9, 2.1.3, 2.3.2, 2.4.13, 2.5.5, 2.5.6.

Compact density meets AA (2.5.8, 24px targets), not AAA.

This release’s test results

Test results for PageIndicator in this release
axe-core (WCAG A, AA, AAA and best practice)40 runs across every story, theme, density and width: 0 violations
Rendered text contrast25 text runs: 0 below 7:1, lowest 16.71:1
Target size48 targets: 0 under 44px in Comfortable
Focus appearance (2.4.13)18 focus stops in 3 browser engines: all pass
Keyboard scriptChromium 3 of 3, Firefox 3 of 3, WebKit 3 of 3

Manual passes with VoiceOver and NVDA haven’t been done yet.

Keyboard

Each step is scripted and run in Chromium, Firefox and WebKit.

PageIndicator keyboard steps
KeyWhat happens
TabTab enters on the current page
ArrowRightRight moves to and selects the next dot
SpaceThe arrow already selected it; Space keeps it

In Figma

The Figma component is PageIndicator. The Figma library isn’t published yet.

Figma to code: Count → count; Current → page.