PaginationPro
Previous and next around a sliding five-page window with a travelling current mark; numbers slide like a belt when the window shifts. Oxyn adds ellipsis, cursor, load-more and page sizes.
oxyn add paginationThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Moving through runs, logs and table pages without losing your place.
- The user wants to see where they are and step or jump.
When not to use
- Native scrolling with thin overlay scrollbars and edge fades that grow with what's left: use Scroll area instead.
- An app sidebar: use Sidebar instead.
- A workspace sidebar: use Workspace sidebar instead.
Installation
Pagination is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add paginationUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Window
A five-page window.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Ellipsis
First, last and neighbours.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Table
With a range and rows per page.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Load more
A Load more button.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Pagination
| Prop | Type | Default | Description |
|---|---|---|---|
page | usize | 1 | Current page (1-based). |
count | usize | 12 | Total pages (ignored with `total`). |
mode | String | "window" | `window` · `ellipsis` · `cursor` · `load-more`. |
label | String | "Pagination" | Landmark name. |
total | Option<usize> | Default::default() | Items in total (adds the range label; pages follow the page size). |
sizes | Vec<usize> | Default::default() | Page sizes offered (with `total`). |
on_page_change | EventHandler<usize> | — | Page changed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Previous, pages, next |
| EnterorSpace | Go to that page |
Accessibility
- A nav landmark; the current page has aria-current=page; previous and next are disabled at the ends.
From the spec
A nav landmark with a label. Each number is a button labelled "Go to page n" (the current one "Page n, current") with aria-current. Previous / next have labels and are disabled at the ends.
Motion & interaction
The current mark travels between numbers on a soft spring. When the window shifts the numbers slide like a belt by the number of slots it moved.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Mark travel | 300 ms | spring (1.3 overshoot) | instant |
| Belt shift | 340 ms | ease.out | instant |
Responsive behaviour
- Window mode keeps the same width on any screen; the row wraps when it must.
Edge cases (spec)
Count 0 shows a single disabled page. Changing page size recomputes the page so the first visible row stays on screen. Window mode never changes width.
Notes for AI
- Import
Paginationfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
PaginationElinoxyn_gpui. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.