Pagination

This topic describes the anatomy, API reference, and variations of the Pagination primitive component.

Anatomy

RequestResponse
import { Pagination } from '@sitecore-search/ui';

const MyPaginationComponent = () => (
  <Pagination.Root>
        <Pagination.PrevPage>«</Pagination.PrevPage>
        <Pagination.Pages>
            <Pagination.Page>1</Pagination.Page>
            ...
            <Pagination.Page>N</Pagination.Page>
        </Pagination.Pages>
        <Pagination.NextPage>»</Pagination.NextPage>
        <Pagination.FirstPage>Go to first page</Pagination.FirstPage>
        <Pagination.LastPage>Go to last page</Pagination.LastPage>
      </Pagination.Root>
);

Using the component

The following tabs describe use of the Pagination primitive component.

API reference

Pagination.Root

The Pagination.Root component wraps all the parts for the pagination component.

Children: Pagination.PagesPagination.PrevPagePagination.NextPagePagination.FirstPage, and Pagination.LastPage

Name

Description

totalPages

The amount of pages of the pagination component.

currentPage

Current page value

defaultCurrentPage

Default selected page value.

onPageChange

A callback that fires when the page value changes.

href

An optional callback to handle when a click on a page number happens.

children

The children of the Root component

Pagination.Pages

The Pagination.Pages component wraps all the pages.

Parent: Pagination.Root

Children: Pagination.Page

Name

Description

children

The children of the component

Pagination.Page

The Pagination.Page component is a page number link.

Parent: Pagination.Pages

Name

Description

page

The page number for the link.

children

The children of the component

Pagination.PrevPage

The Pagination.PrevPage component handles the previous page click.

Parent: Pagination.Root

Name

Description

onClick

An optional callback to handle when a click happens.

children

The children of the component

Pagination.NextPage

The Pagination.NextPage component handles the previous page click.

Name

Description

onClick

An optional callback to handle when a click happens.

children

The children of the component

Pagination.FirstPage

The Pagination.FirstPage component is link that redirects to the first page.

Parent: Pagination.Root

Name

Description

children

The children of the component

Pagination.LastPage

The Pagination.LastPage component is link that redirects to the last page.

Parent: Pagination.Root

Name

Description

children

The children of the component

Do you have some feedback for us?

If you have suggestions for improving this article,