j3w1 / theme

j3w1 / theme4.0.0

j3w1 / command

  • SPEC Overview
  • SPEC Foundations
  • SPEC Components
  • SPEC Patterns
  • SPEC Tokens
  • SPEC Tools
  • SPEC Workbench
  • SPEC Form builder
  • SPEC Task kit
  • SPEC Recipes
  • SPEC Figma bridge
  • SPEC Report an issue
  • SPEC Implement
  • SPEC For agents
  • SPEC Ports
  • SPEC Releases
  • SPEC Specification
  • DEMO Vue application demo

Pagination

Page links for a long result set; the current page takes the selection fill and aria-current, and the compact form reads "3 of 12" between previous and next.

stable · light DOM · 4.0.0. Light DOM retains static content, native semantics, label relationships and host composition without duplicating controls.

Live variants

default

Example destination: pg 2

Example destination: pg 1

Example destination: pg 3

Example destination: pg 4

Example destination: pg 12

Markup
<j3w1-pagination id="example-pagination-default"><nav class="pagination" aria-label="Pagination">
  <ul class="pagination-list">
    <li class="pagination-item"><a class="pagination-link pagination-edge pagination-prev" href="#example-pagination-default-pg-2" aria-label="Previous page, 2"><span class="pagination-glyph" aria-hidden="true">‹</span> Prev</a></li>
    <li class="pagination-item"><a class="pagination-link" href="#example-pagination-default-pg-1" aria-label="Page 1" data-page="1">1</a></li>
    <li class="pagination-item"><a class="pagination-link" href="#example-pagination-default-pg-2" aria-label="Page 2" data-page="2">2</a></li>
    <li class="pagination-item"><a class="pagination-link pagination-current" href="#example-pagination-default-pg-3" aria-label="Page 3" aria-current="page" data-page="3">3</a></li>
    <li class="pagination-item"><a class="pagination-link pagination-link-demo-target" href="#example-pagination-default-pg-4" aria-label="Page 4" data-page="4">4</a></li>
    <li class="pagination-item"><span class="pagination-gap" aria-hidden="true">…</span></li>
    <li class="pagination-item"><a class="pagination-link" href="#example-pagination-default-pg-12" aria-label="Page 12" data-page="12">12</a></li>
    <li class="pagination-item"><a class="pagination-link pagination-edge pagination-next" href="#example-pagination-default-pg-4" aria-label="Next page, 4">Next <span class="pagination-glyph" aria-hidden="true">›</span></a></li>
  </ul>
</nav><p id="example-pagination-default-pg-2" tabindex="-1" class="j3w1-example-target">Example destination: pg 2</p><p id="example-pagination-default-pg-1" tabindex="-1" class="j3w1-example-target">Example destination: pg 1</p><p id="example-pagination-default-pg-3" tabindex="-1" class="j3w1-example-target">Example destination: pg 3</p><p id="example-pagination-default-pg-4" tabindex="-1" class="j3w1-example-target">Example destination: pg 4</p><p id="example-pagination-default-pg-12" tabindex="-1" class="j3w1-example-target">Example destination: pg 12</p></j3w1-pagination>

compact

Example destination: pg 2

Example destination: pg 4

Markup
<j3w1-pagination id="example-pagination-compact"><nav class="pagination pagination-compact" aria-label="Pagination">
  <ul class="pagination-list">
    <li class="pagination-item"><a class="pagination-link pagination-edge pagination-prev pagination-link-demo-target" href="#example-pagination-compact-pg-2" aria-label="Previous page, 2"><span class="pagination-glyph" aria-hidden="true">‹</span> Prev</a></li>
    <li class="pagination-item"><span class="pagination-status" aria-current="page"><span class="pagination-status-current">3</span> of 12</span></li>
    <li class="pagination-item"><a class="pagination-link pagination-edge pagination-next" href="#example-pagination-compact-pg-4" aria-label="Next page, 4">Next <span class="pagination-glyph" aria-hidden="true">›</span></a></li>
  </ul>
</nav><p id="example-pagination-compact-pg-2" tabindex="-1" class="j3w1-example-target">Example destination: pg 2</p><p id="example-pagination-compact-pg-4" tabindex="-1" class="j3w1-example-target">Example destination: pg 4</p></j3w1-pagination>

Install and register

Use the exact version. If npm publication is pending, install the release tarball from the installation guide.

npm install --save-exact @j3w1/ui@4.0.0
import '@j3w1/ui/tokens.css';
import '@j3w1/ui/styles/pagination.css';
import '@j3w1/ui/register/pagination';

Insert the maintained markup above after loading these imports. Its native children provide accessible names and form behavior; the empty custom tag alone does not create a control.

Vue SFC, React, Astro and plain HTML integration →

Copy the complete implementation

npx --package=@j3w1/ui@4.0.0 j3w1-ui copy pagination --out ./vendor/j3w1/pagination

The CLI verifies every file before writing and refuses overwrites. Serve the output over HTTP and open index.html. Keep its modules, CSS, tokens and licence notices together.

Public API

attributes

NameType / signatureMeaning
disabledCustomEventDisable the native controls owned by this instance.
loadingCustomEventMark the primary control busy and prevent duplicate activation.

properties

NameType / signatureMeaning
disabledbooleanDelegates disabled state to native children.
namestringNative control name; application form keys remain explicit.
pagenumberCurrent page when using local button-mode pagination.

methods

NameType / signatureMeaning
refresh(): voidReconnect behavior after replacing native child structure.
focus(options?: FocusOptions): voidFocus the first usable native control.

events

NameType / signatureMeaning
j3w1-pageCustomEventLocal page choice changed; native href links continue to navigate.

Dependencies and verification

Registered components: none. Style dependencies: none.

Package presence establishes an available implementation. Actual passes depend on the tested artifact and environment. Read specification execution evidence; read packed-consumer evidence; inspect the complete state matrix.

Full implementation manifest, API and token dependency closure

Canonical specification

Pagination pagination

  • Family: Navigation
  • Maturity: stable
  • Priority: R1
  • Since: 0.1.0
  • Native control: native nav > ul of links with aria-current="page"
  • specified
  • demonstrated

Page links for a long result set; the current page takes the selection fill and aria-current, and the compact form reads "3 of 12" between previous and next.

Report an issue with this component

Tokens

Focus a role to inspect its values; follow its link for persistent usage and source details.

PartRoleValueUse
root.bgcolor.surface.defaultapproveduse#0d0707D-041 surface.default: color.primitive.modern.panel.
link.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
link.bg-hovercolor.interaction.hover.bgapproveduse#1c1010D-041 interaction.hover.bg: color.primitive.modern.hover.
link.bg-pressedcolor.interaction.pressed.bgobserveduse#420f0cPressed fill.
link.ringcolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
link.text-disabledcolor.text.disabledapproveduse#a3676bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
current.bgcolor.interaction.selection.bgapproveduse#531310Selected row, tab, workspace; D-027 recessed the fill, leaving the 2px indicator and the check to carry selection.
current.textcolor.text.on-selectionobserveduse#f4eeeeText on the selection fill.
current.ringcolor.interaction.focus.ringobserveduse#e539351px dashed focus ring on controls and rows.
gap.textcolor.text.mutedapproveduse#d4868bD-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
status.textcolor.text.defaultapproveduse#e99499D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.
status.emphasiscolor.text.brightapproveduse#ffa2a7D-041 owner correction: rose is the default UI and reading foreground; near-white is reserved for document headings, highlights and contrast-critical fills.

State matrix

Every declared state and combination, statically rendered; the default cell is live. Sizes: compact, comfortable (switch with the density control above).

StateDefaultCompact
default
hover
focus-visible
current
disabled

Purpose

Moves through a paged result set of known size. Feeds use a “load more” button or infinite scroll; jumping to an arbitrary offset is a range field.

Anatomy

Parts as listed in the anatomy; page links have no border.

States

StateVisualNon-colour channel
defaultcolor.text.default; no fill, no border—
hoverbackground → color.interaction.hover.bgcursor: pointer
focus-visible1px dashed color.interaction.focus.ring at −2px, including the current pagethe ring
currentfill color.interaction.selection.bg, text color.text.on-selection; no hoveraria-current="page"
disabledcolor.text.disabled; no fill, no hoveraria-disabled="true"; no href; cursor: not-allowed

A link shows color.interaction.pressed.bg only while pressed.

Keyboard

As in the key table. The current page stays a link to itself so a keyboard user can reload it.

Accessibility

A second pagination on the same page gets a distinct label. Previous and next carry a visible word, not just a glyph; aria-label gives the target page when known (“Previous page, 2”). The list count tells a screen reader how many links follow. Text meets 4.5:1 and the ring 3:1; disabled ends are exempt (house floor 3:1). Targets are at least 24×24 CSS pixels in compact.

Portability

Links with a background and an outline; nothing else. A host that cannot remove href from a disabled link uses a disabled button for the ends and records it. The compact variant is plain text and two links.

Non-examples

Rounded or circular page buttons. A border around every page link. The current page marked by colour or bold alone, without aria-current. Glyph-only previous and next. A disabled end with an href. Hiding the last page number. A horizontally scrolling row.

Contrast report

8 declared pairs measured on resolved sRGB values with the WCAG 2.x formula; 0 waived (decorative only), 0 failing. A pass is a design target for the named role, not an application-wide conformance claim.

PairStateKindForegroundBackgroundRatioMinResult
pagination default textdefaulttextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
pagination hover texthovertextcolor.text.default #e99499color.interaction.hover.bg #1c10108.104.5pass
pagination focus-visible textfocus-visibletextcolor.text.default #e99499color.surface.default #0d07078.724.5pass
pagination focus-visible outlinefocus-visibleuicolor.interaction.focus.ring #e53935color.surface.default #0d07074.733pass
pagination current textcurrenttextcolor.text.on-selection #f4eeeecolor.interaction.selection.bg #53131012.474.5pass
ring on the current page when focusedcurrentuicolor.interaction.focus.ring #e53935color.interaction.selection.bg #5313103.383pass
disabled previous/next (exempt; house floor 3:1)disableduicolor.text.disabled #a3676bcolor.surface.default #0d07074.483pass
gap ellipsis on the panel surface—textcolor.text.muted #d4868bcolor.surface.default #0d07077.224.5pass

Keys

KeyAction
Tab / Shift+TabMoves through previous, each page link and next in order; a disabled end has no href and is not a stop.
EnterFollows the focused link.

For agents

Component JSON ·Implementation brief ·Build a task kit ·

Related: table data-table link button

Stress fixtures: FX-320 FX-ZOOM-200 FX-I18N FX-RTL FX-RM FX-HC FX-STATE-MATRIX