suiss/ui · Component
Page Indicator
A row of dots that shows the current page in a pager or carousel, with an elongated dot for the active page.
Page Indicator is an open-source component from suiss/ui for React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.

PageIndicator draws one dot per page and widens the active one into a pill. Width and position changes animate with Reanimated. When count exceeds maxVisible, only a window of dots is shown; the window slides to keep the active dot near the center and the dots at its edges shrink to hint that more pages exist.
It comes in two sizes, default and sm, and two variants: default uses the foreground color for the active dot and accent uses the primary color.
Installation
- Install the following dependencies:
- Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/page-indicator.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
- Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/page-indicator.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
- Copy the animated view into
components/ui/animated-view.tsx:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/page-indicator.tsx:
- Update the import paths to match your project setup.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
Sizes
Set the size to sm or default.

Accent
The accent variant, which colors the active dot with bg-primary.

Many pages
Twelve pages shown in a sliding window at the start, middle and end.

Interactive
Pass onIndexChange to make the dots pressable. Pressing a dot plays a selection haptic.

Accessibility
- The indicator is a single element with the
adjustablerole, and the dots are not focusable on their own. - Its value is announced as "2 of 5".
- When
onIndexChangeis set, VoiceOver and TalkBack users swipe up or down to move to the next or previous page. - Animations respect the system reduce motion setting.
API Reference
PageIndicator
The PageIndicator component shows the current page as a row of dots.
| Prop | Type | Default |
|---|---|---|
count | number | Required |
index | number | Required |
onIndexChange | (index: number) => void | - |
size | PageIndicatorSize | "default" |
variant | PageIndicatorVariant | "default" |
maxVisible | number | 7 |
Also accepts the props of ViewProps.
The component is controlled: pass count and the zero-based index of the current page. Nothing renders when count is 0. onIndexChange is called with the new index when a dot is pressed or an accessibility action is used; without it the indicator is display-only. maxVisible is the most dots shown at once, with a minimum of 3. The PageIndicatorSize and PageIndicatorVariant types are also exported.
PageIndicatorSize
Values: .sm, .default.
PageIndicatorVariant
Values: .default, .accent.
PageIndicator
The PageIndicator component shows the current page as a row of dots.
| Parameter | Type | Default |
|---|---|---|
count | Int | - |
index | Int | - |
size | Size: .sm | .default | .default |
variant | Variant: .default | .accent | .default |
maxVisible | Int | 7 |
onIndexChange | ((Int) -> Void)? | nil |
PageIndicatorSize
Values: Sm, Default.
PageIndicatorVariant
Values: Default, Accent.
PageIndicator
The PageIndicator component shows the current page as a row of dots.
| Parameter | Type | Default |
|---|---|---|
count | Int | - |
index | Int | - |
modifier | Modifier | Modifier |
onIndexChange | ((Int) -> Unit)? | null |
size | PageIndicatorSize: Sm | Default | PageIndicatorSize.Default |
variant | PageIndicatorVariant: Default | Accent | PageIndicatorVariant.Default |
maxVisible | Int | 7 |
accessibilityLabel | String? | null |




