// Generated by scripts/generate-showcase.mjs. Do not edit directly. page PaginationDetail { layout = "showcase" state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary" state playground_size = ctx.url.searchParams.get("pg_size") ?? "default" state playground_page = Number(ctx.url.searchParams.get("pg_page") ?? "3") state playground_pageSize = Number(ctx.url.searchParams.get("pg_pageSize") ?? "3") state playground_total = Number(ctx.url.searchParams.get("pg_total") ?? "3") state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "compact" state playground_siblingCount = Number(ctx.url.searchParams.get("pg_siblingCount") ?? "3") state playground_showSummary = (ctx.url.searchParams.get("pg_showSummary") ?? "true") === "true" state playground_label = ctx.url.searchParams.get("pg_label") ?? "Pagination" state playground_previousLabel = ctx.url.searchParams.get("pg_previousLabel") ?? "Pagination" state playground_nextLabel = ctx.url.searchParams.get("pg_nextLabel") ?? "Pagination" state playground_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1" seo { title = "Pagination" description = "Theme-aware, responsive pagination component." } view {
Navigation component

Pagination

Theme-aware, responsive pagination component.

12 props1 slots3 outputsTheme readyResponsive
Interactive playground

Configure Pagination

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
<Pagination
  page="3"
  pageSize="3"
  total="3"
  siblingCount="3"
  previousLabel="Pagination"
  nextLabel="Pagination"
/>
Event outputInteract with the preview to inspect the typed payload.
Component props12 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Compact arrows

The default: previous and next with a page counter, and a summary of the range in view.

01
Live preview
Component usage.wrn
<Pagination
  page="2"
  total="137"
  siblingCount="3"
  previousLabel="Pagination"
  nextLabel="Pagination"
/>
Recommended

Numbered pages

Page numbers windowed around the current page with ellipsis gaps, so a large set never renders hundreds of buttons.

02
Live preview
Component usage.wrn
<Pagination
  size="sm"
  page="5"
  total="200"
  variant="numbered"
  label="Compact example"
  previousLabel="Compact example"
  nextLabel="Compact example"
/>
Advanced

Wider window

siblingCount widens how many pages sit either side of the current one.

03
Live preview
Component usage.wrn
<Pagination
  size="lg"
  page="8"
  pageSize="25"
  total="900"
  variant="numbered"
  siblingCount="2"
  label="Advanced example"
  previousLabel="Advanced example"
  nextLabel="Advanced example"
/>
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@changeFires when the component's committed value or selection changes.
@previousFires when the component emits the previous event.
@nextFires when the component emits the next event.
Declarative handlers.wrn
<Pagination
  @change='console.log(payload)'
  @previous='console.log(payload)'
  @next='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"Pagination\"], [data-component=\"Pagination\"]")

if (component) registerOutputHandler(component, "change", (payload) => {
  console.log("change", payload)
})

if (component) registerOutputHandler(component, "previous", (payload) => {
  console.log("previous", payload)
})

if (component) registerOutputHandler(component, "next", (payload) => {
  console.log("next", payload)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
colorstring"primary"No
sizestring"default"No
pagenumber1No
pageSizenumber10No
totalnumber0No
variantstring"compact"No
siblingCountnumber1No
showSummarybooleantrueNo
labelstring"Pagination"No
previousLabelstring"Previous"No
nextLabelstring"Next"No
classstring""No
} }