SwipeUI

Page dots

Expanding current-page markers with optional named page navigation.

npx @swipeui/cli add page-dots
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Showing which page you're on in an onboarding carousel or photo gallery.
  • Tappable dots that jump to a page.
  • Paging indicators under a Carousel.

When not to use it

  • More than about 10 pages; show "3 of 24" instead.
  • Step-by-step flows. Use Stepper.
  • Progress through content. Use Progress.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add page-dots
  • Adds components/swipeui/ui/page-dots.tsx and 5 shared helpers.
  • Installs react-native-reanimated, clsx, tailwind-merge, react-native-worklets, uniwind, expo-haptics. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/onboarding.tsx
import { PageDots } from '@/components/swipeui/ui/page-dots';

<PageDots count={4} current={page} />;

Examples

Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.

API reference

PageDotsProps

PropTypeDefaultDescription
messages?{ page?: (page: number, count: number) => string; }English

Translated page labels; page is one based.

activeShape?"dot" | "pill"'pill'

Active marker shape.

countnumber—

Page count, integer 1–50.

currentnumber—

Current page, zero based.

onPageChange?((index: number) => void)—

Enables named page navigation.

motion?MotionOverride—

Shared selection motion.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Native layout escape hatch.

testID?string—

Root ID.

Native view/input props not listed here pass through where the exported TypeScript type allows them.

Composition and behavior

  • count dots with the current one highlighted.
  • onPageChange makes them tappable.

Feedback lineup settings

PropDoes / default
activeShapeActive marker shape. @default 'pill'
countPage count, integer 1–50.
currentCurrent page, zero based.
onPageChangeEnables named page navigation.
motionShared selection motion.
classNameRoot classes.
styleNative layout escape hatch.
testIDRoot ID.

Behavior and gestures

  • The current dot stretches into a pill so it's easy to spot.
  • With onPageChange, tap a dot to jump to that page; tapping the current dot does nothing.

Accessibility

  • Read-only dots announce "Page 2 of 5".
  • Interactive dots are buttons named "Page 3 of 5", with the current one selected.
  • Dots keep 44-point touch targets when tappable.

Motion

  • Uses the select and press motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • The current dot widens with the select spring.
  • Reduce Motion changes it instantly.

Performance

  • Up to 50 dots, each a tiny animated view.

Notes for AI

  • current is zero-based; count must be 1 to 50.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items