Tangible Design System · @tangible/ui 0.2.29 · Interactive version · Markdown

Pager

import { Pager } from '@tangible/ui';

Interactive docs and examples: Pager in Storybook.

Pager props

Prop Type Default Description
currentPage number Current page (1-indexed)
onPageChange (page: number) => void Called when user selects a different page
totalPages number Total number of pages
className? string Additional class name
hidden? boolean false Hide the entire pager (useful when only 1 page)
labels? PagerLabels Overridable label strings for i18n. All keys are optional — defaults are English.
maxNumbers? number 7 Max page number buttons in smart mode
mode? "ends" | "full" | "simple" | "smart" 'smart' Pagination mode: 'simple' (prev/next only), 'ends', 'full', 'smart'
navStyle? "icon" | "text" 'text' Style for prev/next: 'text' shows labels, 'icon' shows chevrons
onPageSizeChange? (size: number) => void Called when user changes page size
pageSize? number Current page size (for page size selector)
pageSizeOptions? number[] Available page size options
showFirstLast? boolean false Add dedicated first-page / last-page buttons outside prev/next. Most valuable in simple mode and at high page counts — in smart, ends and full the numbered group already carries a "1" and a last page, so these mainly save the user having to find them. Opt-in for that reason: four nav buttons is a lot of chrome to add by default. In flush they join the connected group at the ends, which means prev and next stop being the end segments — the border-collapse rules key off actual position rather than kind, so this needs no special casing.
showInfo? boolean true Show the "Page X of Y" region. The page size selector has its own condition (pageSizeOptions + onPageSizeChange), so this governs the region, not the select. Defaults to true in every mode — including simple, where the status line is arguably redundant. Auto-hiding there is what most consumers probably want, but it would silently change layout for existing simple users, so it stays opt-out.
showJump? boolean false Add a "Go to page" field. For hundreds of pages, where the numbered buttons and even first/last are still slow. Commits on Enter or via its own submit button — deliberately not on blur, which would move the page out from under a user who tabbed away mid-edit. Out-of-range entries clamp to the nearest valid page rather than erroring, and the existing role="status" region announces where the jump actually landed. It renders outside the <nav> landmark, which is the connected button group itself — so someone arriving by landmark finds prev/next and the numbers, not this field. It follows immediately in tab order. Moving it inside would mean wrapping the group rather than being it, and the field would then have to sit beside the buttons instead of at the trailing edge.
size? "lg" | "md" | "sm" 'sm' Control size — joins the shared control-height ladder (sm/md/lg) that Button, IconButton, and the form controls use.
variant? "detached" | "flush" 'flush' Whether nav segments are joined into one group or spaced apart.

Other exports

Examples

Other stories: Default, Icon Navigation, Sizes (interactive page).

Component API tokens

Read via fallback, never declared. Set one on an ancestor to restyle every instance under it.