Pagination
Real anchors, a fixed-width page window and correctly disabled ends.
Live preview
Source
The exact file rendered in the preview above.
components/demos/pagination.tsx
components/ui/pagination.tsx
Demo source — adapt to your project. Foundry is not published as a package.
Usage
For long collections where a user may need to return to a specific page. Rendering anchors rather than buttons keeps pages crawlable, middle-clickable and functional without JavaScript.
- The visible window is computed, so the control never changes width between page 2 and page 200.
- Disabled ends are rendered as spans with `aria-disabled`, not as focusable buttons that do nothing.
- Previous and Next labels are hidden below `sm` but remain in the accessibility tree.
Variants and states
Every entry below is a genuine difference in behaviour or layout, and every one of them is visible in the preview above.
- First page
- Middle with two ellipses
- Last page
- Configurable sibling count
Accessibility
- Landmark
- A labelled `<nav>` containing an ordered list of pages.
- Current page
- Marked with `aria-current="page"` plus a visually hidden ", current page".
- Rel hints
- `rel="prev"` and `rel="next"` are set for user agents that use them.
Foundry implements published ARIA patterns and is tested against them. No WCAG certification is claimed — see the accessibility documentation for what is and is not covered.
Related
All componentsBreadcrumb
A hierarchy trail with a collapsing middle for deep paths and horizontal scroll on mobile.
starter3 variantsTable
A semantic table with two responsive strategies, a focusable scroll region and a built-in empty state.
intermediateFeatured5 variantsFeatured post with list
One lead article plus a scannable list of five.
starterFeatured3 variants