Skip to content
v0.2.10

Pagination

Controlled page navigation with bounded page windows, buttons or native links.

Preview

Page 1 of 20

Use Pagination

Pagination is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
pagination.tsxTSX
"use client";

import { FloodRoot, Pagination } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Pagination page={1} pageCount={20} getHref={page => `?page=${page}`} />
    </FloodRoot>
  );
}

Design notes

  • Use getHref for native route links, onPageChange for local controlled data, or both for a navigation notification. Modifier clicks retain browser behavior.
  • Page and pageCount must be positive safe integers within range. Empty datasets can omit Pagination. siblingCount 0/1/2 controls compactness; endpoints are noninteractive when unavailable.

API reference

PropValuesDefault
pagenumberRequired
pageCountnumberRequired
onPageChange(page: number) => void—
getHref(page: number) => string—
siblingCount0 | 1 | 21
controlSize"sm" | "md" | "lg" | "xl""sm"
disabledbooleanfalse
labelstring"Pagination"
previousLabelstring"Previous page"
nextLabelstring"Next page"
pageLabel(page: number) => string—
Native HTML propsOmit<HTMLAttributes<HTMLElement>, "children" | "onChange">Forwarded
View TypeScript source