DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Pagination

A navigation component that allows users to browse through pages.

  • npm
  • source
  • Ark
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { Pagination } from '@cerberus/react'

Usage

Used to navigate through a series of pages.

Loading example...

Attached

To change the layout style of the pagination, you can use the layout prop from the Group component.

Loading example...

Compact

To show a compact pagination style, use the compact prop. This can be useful for mobile.

Loading example...

Data Slicing

Use the slice() method to paginate actual data arrays. This method automatically slices your data based on the current page and page size.

Loading example...

Alignment

To align the pagination items, use the alignment props on a parent element. This will be differentdepending on the layout.

Loading example...

Controlled

Use the onPageChange prop to control the active page of the pagination.

Loading example...

Page Size

Control the number of items per page dynamically using setPageSize(). This example shows how to integrate a native select element to change the page size.

Note

For uncontrolled behavior, use defaultPageSize to set the initial value. For controlled behavior, use pageSize and onPageSizeChange to programmatically manage the page size.

Loading example...

Customization

You can utilize the css prop to customize the pagination by selecting the desired prmitive data-scope layers.

Loading example...

API

Primitives

Root Props:

PropTypeRequiredDescription
asChildbooleanNoUse the provided child element as the default rendered element, combining their props and behavior.
countnumberNoTotal number of data items
defaultPagenumberNoThe initial active page when rendered.
Use when you don't need to control the active page of the pagination.
defaultPageSizenumberNoThe initial number of data items per page when rendered. Use when you don't need to control the page size of the pagination.
getPageUrl(details: PageUrlDetails) => stringNoFunction to generate href attributes for pagination links. Only used when type is set to "link".
idsPartial<PrimitiveLayers>NoThe ids of the elements in the accordion. Useful for composition.
onPageChange(details: PageChangeDetails) => voidNoCalled when the page number is changed
onPageSizeChange(details: PageSizeChangeDetails) => voidNoCalled when the page size is changed
pagenumberNoThe controlled active page
pageSizenumberNoThe controlled number of data items per page
siblingCountnumberNoNumber of pages to show beside active page
translationsIntlTranslationsNoSpecifies the localized strings that identifies the accessibility elements and their states
type'button', 'link'NoThe type of the trigger element

Ellipsis Props:

PropTypeRequiredDescription
indexnumberYes
asChildbooleanNoUse the provided child element as the default rendered element, combining their props and behavior.

Item Props:

PropTypeRequiredDescription
type'page'Yes
valuenumberYes
asChildbooleanNoUse the provided child element as the default rendered element, combining their props and behavior.

Item Data Attributes:

AttributeValue
[data-scope]pagination
[data-part]item
[data-index]The index of the item
[data-selected]Present when selected

NextTrigger Props:

PropTypeRequiredDescription
asChildbooleanNoUse the provided child element as the default rendered element, combining their props and behavior.

NextTrigger Data Attributes:

AttributeValue
[data-scope]pagination
[data-part]next-trigger
[data-disabled]Present when disabled

PrevTrigger Props:

PropTypeRequiredDescription
asChildbooleanNoUse the provided child element as the default rendered element, combining their props and behavior.

PrevTrigger Data Attributes:

AttributeValue
[data-scope]pagination
[data-part]prev-trigger
[data-disabled]Present when disabled

RootProvider Props:

PropTypeRequiredDescription
valueUsePaginationReturnYes
asChildbooleanNoUse the provided child element as the default rendered element, combining their props and behavior.

On this page

  • Import
  • Usage
  • Attached
  • Compact
  • Data Slicing
  • Alignment
  • Controlled
  • Page Size
  • Customization
  • API
    • Primitives
Edit this page on Github

1 of 500

Emma Wilson

emma@example.com

Liam Johnson

liam@example.com

Olivia Brown

olivia@example.com

Noah Davis

noah@example.com

Ava Martinez

ava@example.com
Items per page:
2
4
6
8
10

Emma Wilson

emma@example.com

Liam Johnson

liam@example.com
1 of 100