GitHubGitHub
← All components
Navigation / component

Pager

Previous and next pagination with current position and optional total.

First pageMiddle pageLast page
<Pager page={2} pageCount={8} total={143} />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { Pager } from '@chanrg/4ui';<Pager page={2} pageCount={8} total={143} />

API reference

Props

PropTypeDefaultDescription
pagenumber1Current page.
pageCountnumber1Total pages.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Uses a labelled pagination navigation landmark.

Dependencies

Button