Garden 9 is now available.
The website has been updated to the latest major version. View previous versions
Skip to main content
Design
Components
Patterns
    • Introduction
      • Overview
    • Foundations
      • Bedrock CSS
      • Design tokens
      • Containers
      • Theming
      • Versions
    • Components
      • Accordion
      • Anchor
      • Avatar
      • Breadcrumbs
      • Buttons
      • Chrome
      • Code block
      • Color picker
      • Color swatch
      • Date picker
      • Draggable
      • Drawer
      • Forms
      • Grid
      • Loaders
      • Menu
      • Modal
      • Notification
      • Pagination
      • Pane
      • Sheet
      • Status indicator
      • Stepper
      • Table
      • Tabs
      • Tags
      • Tiles
      • Timeline
      • Tooltip
      • Tooltip dialog
      • Typography
      • Well
    Table of Contents
    • How to use it
      • Cursor pagination
      • Gap indicator
      • Page padding
      • Offset pagination
    • Configuration
    • API
      • CursorPagination
      • OffsetPagination

    Pagination

    Pagination separates content into pages and allows users to navigate between those pages.


    Table of Contents
    • How to use it
      • Cursor pagination
      • Gap indicator
      • Page padding
      • Offset pagination
    • Configuration
    • API
      • CursorPagination
      • OffsetPagination

    Used for this
    • To divide large amounts of data into manageable chunks

    How to use it

    Cursor pagination

    Cursor-based pagination works by returning a pointer to a specific item in a dataset. There is no concept of the total number of pages or results in the set.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Gap indicator

    The position of a gap indicator (…) can be set in the sequence to represent overflowing pages.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Page padding

    Sets the number of pages that appear between the current page and a gap indicator.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Offset pagination

    Offset-based pagination allows users to see the total number of pages and jump to a specific position within the set.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Configuration

    • Name9.5.3•View source•View on npm
    • Installnpm install @zendeskgarden/react-pagination
    • Depsnpm install react react-dom styled-components @zendeskgarden/react-theming
    • Importimport { CursorPagination, OffsetPagination } from '@zendeskgarden/react-pagination'

    API

    CursorPagination

    Extends HTMLAttributes<HTMLElement>

    CursorPagination.First

    Extends ButtonHTMLAttributes<HTMLButtonElement>

    CursorPagination.Last

    Extends ButtonHTMLAttributes<HTMLButtonElement>

    CursorPagination.Next

    Extends ButtonHTMLAttributes<HTMLButtonElement>

    CursorPagination.Previous

    Extends ButtonHTMLAttributes<HTMLButtonElement>

    OffsetPagination

    Extends HTMLAttributes<HTMLUListElement>

    Prop nameTypeDefaultDescription
    currentPage
    number
    Required

    Sets the current page. Pages start at 1

    labels
    (Record<'next' | 'previous' | 'gap', string> & { renderPage: (p: number) => string; })

    Provides localized labels to pagination elements

    onChange
    ((currentPage: number) => void)

    Handles page change events

    Parameters
    currentPage

    The current page

    pageGap
    number
    2

    Positions the leading and trailing gap indicator, based on the current and total pages

    pagePadding
    number
    2

    Sets the number of pages that appear between the current page and a gap indicator

    totalPages
    number
    Required

    Defines the total number of pages

    Garden is the design system by Zendesk.
    BlogGitHubVersions
    © Zendesk 2025