Black Friday: 30% off Pro

Get 30% off

Updated

Page Indicator

Preview

Customize

Total48
Visible11
Start page6
Drag step14px
Stretch30px

Installation

npx shadcn@latest add https://uibrik.com/r/page-indicator.json
Adds the files to components/uibrik/page-indicator and installs @number-flow/react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/page-indicator.

Usage

import { PageIndicator } from "@/components/uibrik/page-indicator/page-indicator";​<PageIndicator  total={48}  visible={11}  defaultPage={6}  dragStep={14}  stretch={30}  showNumber  onChange={(page) => {}}/>

Where to use Page Indicator

  • Onboarding carousels

    Dashes you can click, scrub or step through show progress and allow jumping.

    Pairs with Progress Dots

  • Slide and step views

    Typing a page number makes long decks easy to navigate.

  • Mobile pagers

    Scrubbing across dashes is fast with one thumb.

Props

PageIndicator
total
Type number
48
Number of pages.
visible
Type number
11
Dashes shown at once.
defaultPage
Type number
6
Starting page when uncontrolled.
dragStep
Type number
14
Drag distance per page while scrubbing.
stretch
Type number
30
How far the grabbed dash stretches past either end.
showNumber
Type boolean
true
Show the number pill; click it to type a page.
onChange
Type (page: number) => void
–
Called when the page changes.
className
Type string
–
Classes for the wrapper.