Skip to main content
Urbicon UI

Pagination

Page navigation with customizable range, layouts, intents, and boundary control.

Playground

Layout Style variant (tailwind-variants)
Variant
Size
Mint
<Pagination
  currentPage={5}
  showNumbers
  showPreviousNext
  totalPages={12}
  visiblePages={5}
/>

01 Examples

Layouts

Four layout presets cover the common contexts: a full page bar for list views, prev/next-only for article flows, a table footer with row counts, and a minimal page indicator for tight UI.

Default — full page bar

Navigation — prev / next only

Table — info + controls

Minimal — page indicator

<div class="flex flex-col gap-2.5">
  <p class="text-text-tertiary text-xs font-medium tracking-wider uppercase">
    Default — full page bar
  </p>
  <Pagination
    currentPage={pg3}
    totalPages={20}
    showFirstLast
    visiblePages={5}
    onPageChange={(p: number) => (pg3 = p)}
  />
</div>
<div class="flex flex-col gap-2.5">
  <p class="text-text-tertiary text-xs font-medium tracking-wider uppercase">
    Navigation — prev / next only
  </p>
  <Pagination
    currentPage={pg3}
    totalPages={20}
    layout="navigation"
    onPageChange={(p: number) => (pg3 = p)}
  />
</div>
<div class="flex flex-col gap-2.5">
  <p class="text-text-tertiary text-xs font-medium tracking-wider uppercase">
    Table — info + controls
  </p>
  <Pagination
    currentPage={pg3}
    totalPages={20}
    layout="table"
    itemsPerPage={25}
    totalItems={500}
    onPageChange={(p: number) => (pg3 = p)}
  />
</div>
<div class="flex flex-col gap-2.5">
  <p class="text-text-tertiary text-xs font-medium tracking-wider uppercase">
    Minimal — page indicator
  </p>
  <Pagination currentPage={pg3} totalPages={20} layout="minimal" />
</div>

Data Table Row

Table layout embedded in a surface panel — a common real-world pattern.
<div class="border-border-subtle bg-surface-elevated rounded-xl border px-5 py-3">
  <Pagination
    currentPage={pg6}
    totalPages={42}
    layout="table"
    variant="ghost"
    intent="neutral"
    size="sm"
    itemsPerPage={25}
    totalItems={1042}
    onPageChange={(p: number) => (pg6 = p)}
  />
</div>

02 Customization

slotClasses Override

Widen the gap, tint the info text, and style the ellipsis.
<Pagination
  currentPage={pg6}
  totalPages={15}
  showInfo
  slotClasses={{
    base: 'gap-2',
    info: 'text-primary font-medium',
    ellipsis: 'text-danger font-bold'
  }}
  onPageChange={(p: number) => (pg6 = p)}
/>

Pill Buttons

Round buttons via slotClasses on the controls slot.
<Pagination
  currentPage={pg6}
  totalPages={10}
  variant="filled"
  intent="secondary"
  slotClasses={{ controls: '[&>*]:rounded-full' }}
  onPageChange={(p: number) => (pg6 = p)}
/>

Terminal Style (unstyled)

Drop all defaults for a monospace, dark-themed pagination.
<Pagination
  unstyled
  currentPage={4}
  totalPages={12}
  showInfo
  showNumbers={false}
  variant="ghost"
  intent="neutral"
  class="terminal-pagination flex items-center justify-between gap-4 font-mono text-sm text-emerald-300"
  slotClasses={{
    info: 'tabular-nums text-emerald-300',
    controls: 'flex gap-2'
  }}
  previousLabel="← prev"
  nextLabel="next →"
/>

Used on more than one list, the pill or terminal styles above become one BlocksProvider preset (presets.Pagination) applied via preset — see Customization.

03 Accessibility

Built-in ARIA

The root <nav> carries role="navigation" and an aria-label. The active page button sets aria-current="page". Disabled boundary buttons expose aria-disabled so screen readers can announce their state.

Keyboard

Tab moves focus between pagination buttons in DOM order. Enter / Space activates the focused button. First/last, prev/next, and numbered buttons are all focusable in natural tab order.

Reduced Motion

Mint effects respect prefers-reduced-motion. Transitions and hover/active feedback are reduced or removed when the user has requested less motion.

04 API Reference

37 props
37 props 2 required
Prop
Type
Default
Description

05 Types

Local type definitions used by this component.

11 types
Name
Kind
Category
Used by
Description

06 Installation

Import

import { Pagination } from '@urbicon-ui/blocks';