JGuang

PageIndicator

PageIndicator · Ant Design Mobile

Preview
npm install antd-mobile@5.43.0

PageIndicator

Indicates which page of the multi-page view is currently displayed.

Install

npm install antd-mobile@5.43.0

antd-mobile is for mobile web, not React Native or Mini Programs. React 19 projects must register createRoot with unstableSetRender at the entry, or imperative APIs such as Toast and Dialog cannot render. Switch dark mode with <html data-prefers-color-scheme="dark">.

Examples come from the official Ant Design Mobile repository (MIT) at the commit published as npm 5.43.0. Presentation helpers such as DemoBlock are JGuang rewrites, not antd-mobile APIs.

Indicates which page of the multi-page view is currently displayed.

When to Use

Applicable to indicate that the current content block can be scrolled horizontally to turn pages.

Demos

PageIndicator

Props

NameDescriptionTypeDefault
colorColor'primary' | 'white''primary'
currentCurrent page (counting from 0)number-
directionLayout direction'horizontal' | 'vertical''horizontal'
totalTotal page numbernumber-

CSS Variables

NameDescriptionDefault
--active-dot-border-radiusrounded corner size the current pagevar(--dot-border-radius)
--active-dot-colordot color of the current pagevar(--adm-color-primary)
--active-dot-sizedot size of the current page13px
--dot-border-radiusrounded corner size the non-current pages1px
--dot-colordot color of the non-current pagesvar(--adm-color-light)
--dot-sizedot size of the non-current pages3px
--dot-spacingspace between dots of the page indicators3px