DocsGitHub
Getting Started
  • Overview
  • Design Tokens
Components
  • Accordion
  • Alert
  • Announcement
  • Avatar
  • Badge
  • BigCalendar
  • Breadcrumb
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Checkbox
  • Chip
  • CloseButton
  • Combobox
  • CommandPalette
  • ContextMenu
  • Currency
  • DatePicker
  • DescriptionList
  • Drawer
  • DropdownMenu
  • EmptyState
  • Field
  • FileUpload
  • FormGrid
  • Hotkey
  • Icon
  • Input
  • Metric
  • Modal
  • MultiSelect
  • NumberInput
  • Pagination
  • Popover
  • ProgressBar
  • Radio
  • Rating
  • SegmentedControl
  • Select
  • SelectionCard
  • Sidebar
  • Skeleton
  • Slider
  • Spinner
  • Stepper
  • Switch
  • Table
  • Tabs
  • Textarea
  • Timeline
  • TimePicker
  • Toast
  • Tooltip
  • TransferList
  • TreeView
  • Wizard
Charts
  • Overview
  • Area Chart
  • Bar Chart
  • Donut Chart
  • Line Chart
  • Pie Chart
  • Stacked Bar Chart

Pagination

Moves through large result sets with controlled or uncontrolled page state and logical RTL keyboard navigation.

Default

A compact, accessible page navigator with automatic ellipsis windows.

……
tsx
<Pagination pageCount={12} defaultPage={4} />

Installation

tsx
import { Pagination } from "madagent";

Controlled

Own the current page when it drives a query, URL, or server request.

…
Selected page: 3
tsx
const [page, setPage] = useState(3);
<Pagination page={page} onChange={setPage} pageCount={20} showEdges />

Sizes and edge controls

Use the small size in table footers and show first/last controls for long datasets.

…
……
tsx
<Pagination size="sm" pageCount={8} />
<Pagination pageCount={40} defaultPage={20} showEdges />

Props

PropTypeDefaultDescription
page
number
-Controlled 1-based page
defaultPage
number
1Initial uncontrolled page
onChange
(page: number) => void
-Called when navigation requests a page
pageCount*
number
-Total number of pages
siblingCount
number
1Pages shown on either side of the current page
showEdges
boolean
falseShows first and last page controls
size
"sm""md"
"md"Control size
ariaLabel
string
"Pagination"Accessible navigation landmark label

RTL Support

Components automatically adapt to right-to-left languages using CSS logical properties.

Preview

……

Usage

tsx
<Pagination pageCount={12} defaultPage={4} ariaLabel="ترقيم الصفحات" />