Skip to main content

Pagination

A row of page-number buttons with optional ellipsis collapse.

When to use it

Use Pagination below a paginated list or table to let users jump between pages. Pages are zero-indexed. Distant pages are collapsed into separators; the first and last pages are always shown.

Import

import 'package:catalyst_ui/catalyst_ui.dart';

Usage

Pagination(
currentPage: _page,
pageCount: 12,
onChanged: (p) => setState(() => _page = p),
)

Parameters

ParameterTypeDefaultDescription
currentPageintrequiredThe zero-based index of the currently active page.
pageCountintrequiredThe total number of pages minus one (the last valid index).
onChangedValueChanged<int>requiredCalled with the zero-based index of the newly selected page.
forwardIconIconData?nullIcon to display on the "next page" button. Falls back to Iconography.forwardIcon.
backIconIconData?nullIcon to display on the "previous page" button. Falls back to Iconography.backIcon.

Iconography

  • The "previous page" button shows backIcon, falling back to context.iconography.backIcon.
  • The "next page" button shows forwardIcon, falling back to context.iconography.forwardIcon.