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

PageButton

  • Stable
  • WCAG 2.2 evidence
  • RTL

One page number of a Pagination or TableFooter. With href it is a React Aria Link (page links for server-rendered or routed pages); without it, a Button (the page changes in place, announced by the parent). The Figma State property maps to isCurrent (aria-current="page"), isDisabled and React Aria's hover, pressed and keyboard-focus attributes. Accessibility: Enter activates links and Enter or Space buttons; keyboard focus shows the Figma 2 px ring (WCAG 2.1.1, 2.4.7); the target is at least 32 px (44 pt, 48 dp on touch platforms, 2.5.8); the current page is announced and shown by fill and weight (1.4.1). Consumer duties: one current page per list, and a name such as "Page 2" through aria-label when the bare number is not enough.

import { PageButton } from "@nexera-ui/react";
Loading example…
7
examples
23
props
2
live controls
1
platform
9
WCAG criteria
0
blocks use 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…
isCurrent
isDisabled
Generated code
import { PageButton } from "@nexera-ui/react";

<PageButton />

Examples 6

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

Current

Figma State=Current (isCurrent): aria-current="page", brand/primary fill and a semibold label.

Loading example…

Disabled

Figma State=Disabled (isDisabled): inactive, skipped by Tab.

Loading example…

Long numbers

Larger numbers widen the button; the 8 px side padding stays.

Loading example…

Narrow width

A 320 px column: a long list of page buttons wraps onto further lines instead of overflowing.

Loading example…

Right to left

Right to left: the list starts at the right; the digits themselves are unchanged.

Loading example…

Props 23

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

23 props shown

page*Nexera
string | number

The page number or label shown in the button. It names the control unless aria-label is set; a longer name such as "Page 2" must still contain the visible text (WCAG 2.5.3).

Default –
isCurrentNexera
boolean

The button is the current page. It gets aria-current="page" and is shown by a brand/primary fill and a semibold label, not by colour alone.

Default false
classNameNexera
string

Extra classes, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style.

Default –
idReact Aria
string

The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).

Default –
isDisabledReact Aria
boolean

Whether the link is disabled.

Default –
autoFocusReact Aria
boolean

Whether the element should receive focus on render.

Default –
onPressReact Aria
(e: PressEvent) => void

Handler that is called when the press is released over the target.

Default –
onPressStartReact Aria
(e: PressEvent) => void

Handler that is called when a press interaction starts.

Default –
onPressEndReact Aria
(e: PressEvent) => void

Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.

Default –
onPressChangeReact Aria
(isPressed: boolean) => void

Handler that is called when the press state changes.

Default –
onPressUpReact Aria
(e: PressEvent) => void

Handler that is called when a press is released over the target, regardless of whether it started on the target or not.

Default –
aria-labelReact Aria
string

Defines a string value that labels the current element.

Default –
aria-labelledbyReact Aria
string

Identifies the element (or elements) that labels the current element.

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –
hrefReact Aria
string

A URL to link to. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).

Default –
hrefLangReact Aria
string

Hints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).

Default –
targetReact Aria
HTMLAttributeAnchorTarget

The target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).

Default –
relReact Aria
string

The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).

Default –
downloadReact Aria
string | boolean

Causes the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).

Default –
pingReact Aria
string

A space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).

Default –
referrerPolicyReact Aria
"" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"

How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).

Default –
routerOptionsReact Aria
never

Options for the configured client side router.

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

6 direct · 3 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.1Use of ColorLevel A · supporting test
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.4Link Purpose (In Context)Level A · tested directly
  • 2.4.7Focus VisibleLevel AA · tested directly
  • 2.5.3Label in NameLevel A · tested directly
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · 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:.

  • data-current
  • data-disabled
  • data-hovered
  • data-pressed
Usage
<PageButton className="data-current:opacity-90 shadow-sm" />

Used in blocks

No block uses PageButton yet.

Related components