Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

CursorPager

  • Stable
  • WCAG 2.2 evidence
  • RTL

A previous and next pair for data without stable page numbers, such as an activity log or a cursor API. A named nav landmark with two buttons (or links with previousHref and nextHref) and the context text between them. At the first or last page the matching button is inactive through aria-disabled and stays in the tab order, so keyboard focus is not lost when a press makes it inactive; presses are ignored (WCAG 2.1.1, 2.4.1, 2.4.3, 2.4.7, 4.1.2). The chevrons mirror in right-to-left layouts. Use Pagination where pages are numbered. Consumer duties: a unique landmark name, a context that names what the page shows, and moving focus to the new content where that helps.

import { CursorPager } from "@nexera-ui/react";
Loading example…
8
examples
10
props
1
live controls
1
platform
10
WCAG criteria
1
block uses it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
status
Generated code
import { CursorPager } from "@nexera-ui/react";

<CursorPager />

Examples 7

The same examples as Storybook, rendered live. Open Code to copy one.

First page

Figma State=First page: Previous is inactive (aria-disabled) but keeps focus.

Loading example…

Last page

Figma State=Last page: Next is inactive.

Loading example…

Interactive

Wired to three pages of a log: pressing Next on the second page keeps focus on the button when it becomes inactive.

Loading example…

Narrow width

A 320 px column: the context sits above the two buttons, which share the row.

Loading example…

Long labels

Long translated texts wrap and are never truncated.

Loading example…

Right to left

Right to left: Previous is at the right and the chevrons mirror.

Loading example…

Props 10

Press "Try it" on a card to load that prop into the playground.

10 props shown

statusNexera
"first-page" | "last-page"

Where the user is. first-page makes Previous inactive and last-page makes Next inactive; leave it out for a page in the middle. A list with a single page needs no pager.

Default –
contextNexera
ReactNode

Text that says what the current page shows. With buttons, a string context is announced politely when it changes, because the new page replaces the content in place (WCAG 4.1.3).

Default –
onPreviousNexera
() => void

Called when Previous is pressed (button mode).

Default –
onNextNexera
() => void

Called when Next is pressed (button mode).

Default –
previousHrefNexera
string

Makes Previous a link, for cursors that live in the address (?before=…). Nothing is announced: navigation announces itself.

Default –
nextHrefNexera
string

Makes Next a link.

Default –
previousLabelNexera
string

Visible text and name of the previous button. Translate it.

Default Previous
nextLabelNexera
string

Visible text and name of the next button. Translate it.

Default Next
aria-labelNexera
string

Accessible name of the pagination landmark, for example "Employees". Say what is paged: a page with several nav landmarks needs a unique name for each. Translate it. Accessible name when it must differ from the visible text.

Default –
aria-labelledbyNexera
string

Id(s) of visible element(s) that name the landmark; wins over aria-label. Id(s) of visible element(s) that name the landmark, for example the heading of the table.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

7 direct · 3 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.10ReflowLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.1Bypass BlocksLevel A · tested directly
  • 2.4.3Focus OrderLevel A · tested directly
  • 2.4.4Link Purpose (In Context)Level A · tested directly
  • 4.1.2Name, Role, ValueLevel A · tested directly
  • 4.1.3Status MessagesLevel AA · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<CursorPager className="shadow-sm" />

Used in blocks

Related components