Pagination
Page navigation, size selection, quick entry and custom elements.
When to use
Pagination divides a large set of posts into pages. It reports the page number and size, and the application controls the loading, filtering and output of data. You can use the built-in pagination Table for the table.
The prefix example lets you switch the shared ConfigProvider.prefixCls or the local prefixCls. The current page, the number you typed and the page item dimensions stay the same. The page size selector uses the shared prefix.
Page number and sample size
total - number of records, pageSize - number of records on the page, current starts from 1. defaultCurrent and defaultPageSize are read once. For external control and state saving, use bind:current and bind:pageSize.
| Problem | Setting | Example |
|---|---|---|
| Paginate posts | total, pageSize |
Main scenario |
| Select number of records | showSizeChanger, pageSizeOptions |
Size selection |
| Go to number directly | showQuickJumper |
Direct transition |
| Save state outside | bindings | External condition |
| Show quantity and range | snippet showTotal |
Summary |
When changing size, the package retains the page number and limits it to the new range. onChange gets page and pageSize; the third argument info.recommendPage from Ant Design 6.7 is not here yet. If you need to maintain the visibility of a specific entry, calculate the required number in the application.
The request SHOULD pass a matched page/pageSize pair. When changing filters, update the total and page number; Late responses from a previous request should not replace new data.
Presentation and additional elements
showSizeChanger enables Select. If prop is missing, it appears when total is above totalBoundaryShowSizeChanger, default 50. Use showSizeChanger.options to supply custom labels for page sizes. The object also accepts other Select props. Use components.sizeChanger to supply a snippet for a custom element with value, options, disabled and onChange.
showQuickJumper accepts a boolean or a goButton object. simple includes a compact representation; The readOnly object disables number editing. showLessItems reduces the number of adjacent pages, hideOnSinglePage hides navigation when there is a single page.
itemRender receives number, type, ready originalElement snippet and info with onClick, label, disabled and active handler. When replacing a finished button, save these properties on your own control. Transition icons also accept snippets. Details are shown in your rendering.
Dimensions, availability and limitations
align specifies start/center/end. size supports current large/medium/small. responsive operates without explicitly setting size or componentSize to the ConfigProvider. In a theme with the Source engine enabled, the xs border is taken from theme.token.screenXSMax; normal mode without theme uses the standard 575px. The nested provider inherits the threshold, theme.inherit:false returns the standard one. New design tokens are applied without remount, saving the page and draft jumper.
Example of thresholds compares 639px and 575px. It runs in a standalone Svelte context, since the gallery's common componentSize overwhelms responsive. On the server, the shell of this example shows a stub; Pagination itself supports SSR and does not add mini before mount. Incorrect order of screen* boundaries is rejected already with SSR.
responsive adds a mini class, but by itself does not guarantee a smaller height, as in the pinned Ant Design 6.6.8. For a fixed small size, specify small. The quick jump field is hidden by standard CSS at a width of up to 576px, regardless of theme.token.screenXSMax; the main navigation remains.
The root is nav, the pages are in the list. Provide a clear aria-label, especially if there is multiple Pagination on the page. Native rendering must maintain keyboard accessibility and the disabled state.
ConfigProvider.pagination sets general semantic defaults, showSizeChanger and its threshold. Component Pagination tokens change the sizes and states of items. class refers to ul, semantic root refers to nav. prefixCls changes DOM classes and styling. Changing the prefix preserves item dimensions in the compact theme as well. NativeElement-ref is not available yet.
Examples
Basic pagination
Five pages without choosing a size. The number of the active page is available through aria-current, transitions are performed by native buttons.
<script lang="ts">
import { Pagination } from '@woodger/antd';
</script>
<Pagination total={50} showSizeChanger={false} aria-label={("Basic pages")} />
Alignment
align positions pagination at the beginning, center, or end of the available line.
<script lang="ts">
import { Pagination, type PaginationProps } from '@woodger/antd';
let align = $state<PaginationProps['align']>('center');
</script>
<style>
label {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin-bottom: 16px;
}
</style>
<label>{("Page Alignment ")}<select bind:value={align}>
<option value="start">
{("At the beginning")}
</option>
<option value="center">
{("Center")}
</option>
<option value="end">{("At the end")}</option>
</select></label>
<Pagination total={50} {align} showSizeChanger={false} aria-label={("Aligned pages")} />
Many pages
Transitions through ellipses shorten a long list. showLessItems reduces the number of adjacent pages.
<script lang="ts">
import { Pagination, Checkbox } from '@woodger/antd';
let compact = $state(false);
</script>
<style> .controls { margin-bottom:16px; }
</style>
<div
class="controls"
><Checkbox
bind:checked={compact}
>{("Fewer adjacent pages")}</Checkbox></div>
<Pagination total={5000} defaultCurrent={6} showLessItems={compact} showSizeChanger={false}
aria-label={("Long list of pages")} />
Number of entries
showSizeChanger.options supplies labels for page sizes. bind:pageSize and bind:current store numeric values, and the handlers display both events.
<script lang="ts">
import { Pagination } from '@woodger/antd';
let current = $state(2);
let pageSize = $state(10);
let events = $state<string[]>([]);
</script>
<style>
output {
display: block;
margin-top: 16px;
overflow-wrap: anywhere;
}
</style>
<Pagination total={137} bind:current bind:pageSize
showSizeChanger={{
'aria-label': ("Records on the example page"),
options: [
{ value: 10, label: ("10 records per page") },
{ value: 20, label: ("20 records per page") },
{ value: 50, label: ("50 records per page") }
]
}}
onShowSizeChange={(page, size) => { events = [...events, `Size: ${page}/${size}`].slice(-4); }}
onChange={(page, size) => { events = [...events, `Page: ${page}/${size}`].slice(-4); }}
aria-label={("Size selection pages")}
/>
<output
aria-label={("Size Status Pagination")}
>{("Page ")}{current}{(", by ")}{pageSize}</output>
<output aria-label={("Pagination size events")}>{(events.join(' → ')
|| ("No events"))}</output>
Quick link
showQuickJumper accepts Enter or goButton confirmation. On a narrow screen, the field hides the standard responsive CSS.
<script lang="ts">
import { Pagination } from '@woodger/antd';
let current = $state(1);
let confirmed = $state(1);
</script>
<style>
.stack {
display: grid;
gap: 24px;
}
output {
display: block;
margin-top: 16px;
}
</style>
<div class="stack">
<Pagination total={500} bind:current showSizeChanger={false} showQuickJumper
aria-label={("Quick jump Enter")} />
<Pagination
total={500}
bind:current={confirmed}
showSizeChanger={false}
showQuickJumper={{ goButton: "Go" }}
aria-label={("Quick jump with button")}
/>
</div>
<output aria-label={("Quick Pagination Pages")}>Enter: {current}{("; button: ")}{confirmed}</output>
small
medium
large
Dimensions
The package accepts small, medium and large. medium fits regular size; Setting up a local component takes precedence over the global one.
<script lang="ts">
import { Pagination, type ComponentSize } from '@woodger/antd';
const sizes: readonly ComponentSize[] = ['small', 'medium', 'large'];
</script>
<style>
.stack {
display: grid;
gap: 24px;
}
p {
margin: 0 0 12px;
color: var(--ant-color-text-secondary);
}
</style>
<div class="stack">
{#each sizes as size (size)}
<div><p>{(size)}</p><Pagination total={50} {size} showSizeChanger={false}
aria-label={("Pages " + String((size)) + "")} /></div>
{/each}
</div>
Simple mode
simple shows the current page and the total number of pages. readOnly removes number editing, preserving the transition buttons.
<script lang="ts">
import { Pagination } from '@woodger/antd';
let current = $state(2);
let readOnly = $state(2);
</script>
<style>
.stack {
display: grid;
gap: 24px;
}
output {
display: block;
margin-top: 16px;
}
</style>
<div class="stack">
<Pagination total={500} simple bind:current showSizeChanger={false}
aria-label={("Simple pages")} />
<Pagination total={500} simple={{ readOnly: true }} bind:current={readOnly}
showSizeChanger={false} aria-label={("Simple pages without input")} />
</div>
<output
aria-label={("Simple numbers Pagination")}
>{("Input: ")}{current}{("; without input: ")}{readOnly}</output>
Application status
Two-way binding stores the number outside the Pagination. The application button returns the first page.
<script lang="ts">
import { Pagination, Button } from '@woodger/antd';
let current = $state(3);
</script>
<style>
.footer {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 12px;
margin-top: 16px;
}
</style>
<Pagination total={50} bind:current showSizeChanger={false} aria-label={("Managed pages")} />
<div class="footer">
<Button onclick={() => { current = 1; }}>
{("Return first page")}
</Button>
<output
aria-label={("Managed number Pagination")}
>{("Page ")}{current}</output>
</div>
Total records
showTotal - Svelte Snippet with the total number and included borders of the current page.
<script lang="ts">
import { Pagination } from '@woodger/antd';
</script>
<Pagination total={137} defaultCurrent={3} showSizeChanger={false} aria-label={("Pages with summary")}>
{#snippet showTotal(total: number, range: [number, number])}
<span>{(range[0])}–{(range[1])}{(" from ")}{(total)}{(" records")}</span>
{/snippet}
</Pagination>
All main features
Combines total quantity, size selection, quick navigation and regular page buttons in one line.
<script lang="ts">
import { Pagination } from '@woodger/antd';
let current = $state(1);
let pageSize = $state(10);
</script>
<Pagination total={500} bind:current bind:pageSize showSizeChanger showQuickJumper
aria-label={("Full pagination")}>
{#snippet showTotal(total: number, range: [number, number])}{(range[0])}–{(range[1])}{(" from ")}{(total)}{/snippet}
</Pagination>
Your own transition buttons
itemRender gets originalElement and info. Its native button uses info.onClick and info.disabled; the remaining elements retain the standard renderer.
<script lang="ts">
import type { Snippet } from 'svelte';
import { Pagination, type PaginationItemInfo, type PaginationItemType } from '@woodger/antd';
let current = $state(1);
</script>
<style>
button {
border:0;
background:transparent;
color:inherit;
font:inherit;
cursor:pointer;
padding:0 6px;
}
button:disabled {
color: var(--ant-color-text-disabled);
cursor: not-allowed;
}
button:focus-visible {
outline: 2px solid var(--ant-color-primary);
outline-offset: 2px;
}
output {
display: block;
margin-top: 16px;
}
</style>
{#snippet itemRender(
page: number,
type: PaginationItemType,
originalElement: Snippet,
info: PaginationItemInfo
)}
{#if type === 'prev' || type === 'next'}
<button type="button" disabled={info.disabled} aria-label={(info.label)}
onclick={info.onClick}>{(type === 'prev' ? "Back" : "Next")}</button>
{:else}
{@render originalElement()}
{/if}
{/snippet}
<Pagination total={50} bind:current showSizeChanger={false} {itemRender}
aria-label={("Custom page transitions")} />
<output
aria-label={("Number of your renderer Pagination")}
>{("Page ")}{current}</output>
Your choice of size
components.sizeChanger accepts a Snippet with options, value, disabled and onChange. The example uses the available native select.
<script lang="ts">
import { Pagination, Checkbox, type PaginationSizeChangerInfo } from '@woodger/antd';
let pageSize = $state(10);
let disabled = $state(false);
</script>
<style>
.controls { margin-bottom:16px; }
select {
max-width: 100%;
color: inherit;
background: var(--ant-color-bg-container);
font: inherit;
}
output {
display: block;
margin-top: 16px;
}
</style>
{#snippet sizeChanger(info: PaginationSizeChangerInfo)}
<select class={info.class} value={info.value} disabled={info.disabled}
aria-label={("Custom page size")}
onchange={event => info.onChange(Number(event.currentTarget.value))}>
{#each info.options as option (option.value)}
<option
value={option.value}
>{typeof option.label === 'string' ? option.label : option.value}</option>
{/each}
</select>
{/snippet}
<div class="controls">
<Checkbox bind:checked={disabled}>
{("Disable your size changer")}
</Checkbox>
</div>
<Pagination total={137} bind:pageSize {disabled} showSizeChanger pageSizeOptions={[10, 20, 50]}
components={{ sizeChanger }} aria-label={("Pages with your choice of size")} />
<output
aria-label={("Custom size Pagination")}
>{("By ")}{pageSize}</output>
Semantic styles and ConfigProvider
The general pagination configuration specifies root and size selection behavior. Local styles add styling to items.
<script lang="ts">
import { Pagination, ConfigProvider } from '@woodger/antd';
</script>
<ConfigProvider pagination={({
showSizeChanger: false,
classNames: { root: 'provider-pagination-root' },
styles: {
root: `
padding: 12px;
border: 1px solid var(--ant-color-primary-border);
border-radius: 8px;
`
}
})}>
<Pagination total={50} defaultCurrent={2} aria-label={("Designed pages")}
classNames={{ item: 'semantic-pagination-item' }}
styles={({ props }) => ({ item: props.total ? 'border-radius:50%' : '' })}
/>
</ConfigProvider>
Component tokens
Local theme changes the size of regular items and the color of the active page. The theme of the adjacent cards is preserved.
<script lang="ts">
import { Pagination, ConfigProvider, theme } from '@woodger/antd';
const tokens = theme.useToken();
let itemSize = $state(36);
</script>
<style>
label {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin-bottom: 16px;
}
</style>
<label>{("Page element size ")}<input
type="range"
min="28"
max="44"
bind:value={itemSize}
/>
<output>{itemSize}px</output>
</label>
<ConfigProvider theme={{
cssVar: {}, components: {
Pagination: {
itemSize,
itemActiveBg: tokens.token.colorSuccessBg,
itemActiveColor: tokens.token.colorSuccess
}
}
}}>
<Pagination total={50} size="medium" showSizeChanger={false} aria-label={("Pages with your own theme")} />
</ConfigProvider>
Unavailable state
disabled disables buttons and standard size selection. The setting can be switched without losing the number.
<script lang="ts">
import { Pagination, Checkbox } from '@woodger/antd';
let disabled = $state(true);
</script>
<style> .controls { margin-bottom:16px; }
</style>
<div
class="controls"
><Checkbox
bind:checked={disabled}
>{("Unavailable Pagination")}</Checkbox></div>
<Pagination total={137} defaultCurrent={2} {disabled} showSizeChanger
aria-label={("Unavailable pages")} />
All entries are placed on one page; navigation is hidden.
Single page
hideOnSinglePage removes the entire navigation if all posts fit on one page.
<script lang="ts">
import { Pagination, Checkbox } from '@woodger/antd';
let hide = $state(true);
</script>
<style>
.controls { margin-bottom:16px; }
p {
margin: 16px 0 0;
color: var(--ant-color-text-secondary);
}
</style>
<div
class="controls"
><Checkbox
bind:checked={hide}
>{("Hide one page")}</Checkbox></div>
<Pagination total={7} hideOnSinglePage={hide} showSizeChanger={false}
aria-label={("Single page")} />
<p>{(hide ? "All entries are placed on one page; navigation is hidden." : "Navigation shown.")}</p>
Localization and RTL
ConfigProvider inherits direction and locale. The English available button names only apply to this card.
<script lang="ts">
import { Pagination, Checkbox, ConfigProvider, enUS } from '@woodger/antd';
let rtl = $state(false);
</script>
<style> .controls { margin-bottom:16px; }
</style>
<div class="controls"><Checkbox bind:checked={rtl}>RTL Pagination</Checkbox></div>
<ConfigProvider locale={enUS} direction={rtl ? 'rtl' : 'ltr'}>
<Pagination total={50} showSizeChanger={false} aria-label={("Localized pages")} />
</ConfigProvider>
Post pagination
Browse script with bind:current/pageSize and record range. The condition of this card is regardless of review.
<script lang="ts">
import { Pagination } from '@woodger/antd';
let current = $state(1);
let pageSize = $state(10);
</script>
<style>
output {
display: block;
margin-top: 16px;
}
</style>
<Pagination total={137} bind:current bind:pageSize aria-label={("Post pages")}>
{#snippet showTotal(total: number, range: [number, number])}{(range[0])}–{(range[1])}{(" from ")}{(total)}{/snippet}
</Pagination>
<output
aria-label={("Post pagination")}
>{("Page: ")}{current}{(". Entries on the page: ")}{pageSize}.</output>
Changing the prefix preserves the item size, the current page and the number you typed. The page size selector uses the shared prefix.
CSS prefixes Pagination
Common namespace ConfigProvider and local prefixCls; the state of the component is preserved when the name is changed.
<script lang="ts">
import { Checkbox, ConfigProvider, Pagination } from '@woodger/antd';
let custom = $state(true);
let local = $state(true);
const prefix = $derived(custom ? 'suite' : 'ant');
const localPrefix = $derived(local ? 'project-pagination' : '');
let current = $state(2);
</script>
<style>
.example,
.prefix-stage {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 16px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("General prefix Pagination suite")}</Checkbox>
<Checkbox bind:checked={local}>{("Local prefix Pagination")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix} theme={{ cssVar: { prefix: 'pagination-theme' } }}>
<div class="prefix-stage">
<Pagination prefixCls={localPrefix} bind:current total={100} showQuickJumper
showSizeChanger={false} aria-label={("Pagination with prefix")} />
<output aria-label={("Pagination page with prefix")}>{("Page: ")}{current}</output>
</div>
</ConfigProvider>
<output
aria-label={("CSS prefix Pagination")}
>{("General: ")}{prefix}{("; local: ")}{(localPrefix
|| ("from the provider"))}</output>
<p>
{("Changing the prefix preserves the item size, the current page and the number you typed.")}
{("The page size selector uses the shared prefix.")}
</p>
</div>
The standalone example runs after mount.
This example has a separate context without componentSize. The general gallery settings do not apply to it: this way the priority of responsive is visible without changing the rest of the site cards.
responsive and theme thresholds
An independent example without a common componentSize: screenXSMax, inheritance and inherit:false, priority size and saving a quick-jump draft when changing tokens.
ResponsivePreview.svelte<script lang="ts"> import { Checkbox, ConfigProvider, Pagination, ruRU } from '@woodger/antd'; let custom = $state(true); let fixed = $state(false); let current = $state(4); let changes = $state(0); const token = $derived( custom ? { screenXSMax: 639, screenSMMin: 640, screenSM: 640, screenSMMax: 899, screenMDMin: 900, screenMD: 900 } : {} ); </script> <style> .example, .scopes { display: grid; gap: 20px; min-width: 0; } .controls { display: flex; flex-wrap: wrap; gap: 12px; } section { min-width: 0; padding: 16px; border-radius: 8px; background: var(--ant-color-bg-container); color: var(--ant-color-text); } h4 { margin: 0 0 12px; } p { margin: 0; } </style> <div class="example"> <div class="controls"> <Checkbox bind:checked={custom}>{("Own thresholds Pagination")}</Checkbox> <Checkbox bind:checked={fixed} >{("Fix size Pagination large")}</Checkbox> </div> <ConfigProvider locale={ruRU} theme={{ cssVar: { prefix: 'responsive-pager' }, token }}> <div class="scopes"> <section aria-label={("Your threshold Pagination")}> <h4>{("Own thresholds")}</h4> <Pagination class="responsive-pagination-main" aria-label={("Pages with their own thresholds")} responsive size={fixed ? 'large' : undefined} bind:current total={100} showQuickJumper showSizeChanger={false} onChange={() => { changes++; }} /> </section> <ConfigProvider> <section aria-label={("Pagination threshold inheritance")}> <h4>{("Legacy thresholds")}</h4> <Pagination class="responsive-pagination-inherited" aria-label={("Pages with inherited thresholds")} responsive defaultCurrent={4} total={100} showSizeChanger={false} /> </section> </ConfigProvider> <ConfigProvider theme={{ inherit: false }}> <section aria-label={("Pagination threshold reset")}> <h4>{("Standard thresholds")}</h4> <Pagination class="responsive-pagination-reset" aria-label={("Pages with standard thresholds")} responsive defaultCurrent={4} total={100} showSizeChanger={false} /> </section> </ConfigProvider> </div> </ConfigProvider> <output aria-label={("Status responsive Pagination")} >{("Page: ")}{current}{("; changes: ")}{changes}</output> <p> {("Custom screenXSMax: 639px instead of 575px. The nested provider inherits the threshold, inherit:false returns the standard one. Explicit size takes precedence. Responsive adds a mini class; its presence in itself does not change the height, as in Ant Design 6.6.8.")} </p> </div>Responsive.svelte<script lang="ts"> import { mount, onMount, unmount } from 'svelte'; import ResponsivePreview from './ResponsivePreview.svelte'; let target: HTMLDivElement; let mounted = $state(false); onMount(() => { const preview = mount(ResponsivePreview, { target, context: new Map() }); mounted = true; return () => { void unmount(preview); }; }); </script> <style> div { min-width: 0; } p { margin: 16px 0 0; } </style> <div bind:this={target} role="group" aria-label={("Self-responsive Pagination example")}></div> {#if !mounted}<p>{("The standalone example runs after mount.")}</p>{/if} <p> {("This example has a separate context without componentSize. The general gallery settings do not apply to it: this way the priority of responsive is visible without changing the rest of the site cards.")} </p>
API
Examples are checked against the current ant.design page and the public API of the installed package. Full definitions of Props are in @woodger/antd.
| Theme | Example or limitation |
|---|---|
| Basic | Regular pages. |
| Align | Three alignments. |
| More | Long list and shortened buffer. |
| Changer | Size and handlers. |
| Jumper | Enter and jump button. |
| Size | small, medium and large public package. |
| Simple mode | Enter number and readOnly. |
| Controlled | Binding and external control. |
| Total number | showTotal-snippet. |
| Show All | Sharing opportunities. |
| Prev and next | Your own itemRender and originalElement. |
| Custom component | components.sizeChanger-snippet. |
| Custom semantic dom styling | Design and ConfigProvider.pagination. |
| Property | Description | Type | Default |
|---|---|---|---|
prefixCls | Full CSS prefix of the component and its parts. A non-empty local prop takes precedence; empty string and undefined inherit ConfigProvider. The namespace of the topic is set separately. | string | ConfigProvider.prefixCls + "-pagination" |
total | Total number of records, not number of pages. | number | 0 |
current | bind:current connects the number to the application state. | number | defaultCurrent: 1 |
defaultCurrent | Starting number, read once. | number | 1 |
pageSize | bind:pageSize binds size to application state. | number | defaultPageSize: 10 |
defaultPageSize | Initial size, read once. | number | 10 |
pageSizeOptions | Standard size selection options. | readonly (number | string)[] | 10, 20, 50, 100 |
showSizeChanger | options supplies choices with a numeric size and a label. The configuration also accepts Select settings and handlers. | boolean | PaginationSizeChangerProps | total > 50 |
totalBoundaryShowSizeChanger | Threshold for automatically turning on size selection. | number | 50 |
showQuickJumper | Transition field Enter; goButton adds confirmation. | boolean | { goButton?: PaginationContent } | false |
simple | Current number and number of pages; readOnly disables input. | boolean | { readOnly?: boolean } | false |
showTotal | Range of the current page with borders enabled. | Snippet<[total, range]> | — |
showLessItems | Fewer neighbors and the transition of the ellipsis to three pages. | boolean | false |
showPrevNextJumpers | Shows transitions through ellipses. | boolean | true |
hideOnSinglePage | Hides the entire nav on one page. | boolean | false |
align | Line alignment. | 'start' | 'center' | 'end' | — |
size | Local size takes precedence. | 'small' | 'medium' | 'large' | From ConfigProvider |
responsive | XS by theme.token.screenXSMax includes mini only without an explicitly specified size in props or provider. Tokens update queries without remount; The mini class itself does not guarantee a reduction in height. | boolean | false |
disabled | Disables control. | boolean | From ConfigProvider |
onChange | Two arguments; info.recommendPage from Ant Design 6.7.0 is missing yet. | (page, pageSize) => void | — |
onShowSizeChange | When resizing, it is called before onChange. | (previousPage, pageSize) => void | — |
itemRender | Its renderer binds info.onClick/disabled to native control. | Snippet<[page, type, originalElement, info]> | — |
components | Customizable size selection. | { sizeChanger?: Snippet<[PaginationSizeChangerInfo]> } | — |
classNames | Object or function for root and item. | PaginationSemantic | — |
styles | CSS lines root and item; local values take precedence over provider. | PaginationSemantic | — |
locale | Names of buttons, fields and suffix; snake_case aliases are supported. | Partial<PaginationLocale> | From ConfigProvider |
Semantic DOM
Root - nav with an accessible name and a list of ul. items - li with native buttons, the active page is marked aria-current. The border and disabled state buttons are indeed not accessible from the keyboard.
Semantic slots: root refers to nav, item - to li regular pages and transitions. The former prop class refers to ul. ConfigProvider.pagination supports class/style, semantic slots, showSizeChanger and its threshold; local parameters take precedence.
The quick jump field inherits the Input option, and the page size selection inherits Select: closest Form.variant → corresponding component setting → general ConfigProvider.variant → outlined.
itemRender gets ready originalElement and info with onClick, disabled, active and label. If you are replacing originalElement, move the handler and accessible name to your native button.
Registration tokens
Component tokens work through ConfigProvider theme.components.Pagination. The example changes the items size and active color. Shared tokens inherit the topic of the section.
| Token | Purpose |
|---|---|
itemActiveBg | Background of the active item. |
itemActiveBgDisabled | Background of the inaccessible active item. |
itemActiveColor | Text of the active item. |
itemActiveColorDisabled | Inaccessible active text. |
itemActiveColorHover | Active text on hover. |
itemBg | Normal item background. |
itemInputBg | Field background. |
itemLinkBg | Background of transition buttons. |
itemSize | Regular item size. |
itemSizeLG | Large size item. |
itemSizeSM | Small size item. |
miniOptionsSizeChangerTop | Shift size changer to mini. |
| Token | Current value |
|---|---|
colorBgContainer | #ffffff |
colorBgContainerDisabled | rgba(0,0,0,0.04) |
colorBgTextActive | rgba(0,0,0,0.15) |
colorBgTextHover | rgba(0,0,0,0.06) |
colorBorder | #d9d9d9 |
colorBorderDisabled | #d9d9d9 |
colorFillSecondary | rgba(0,0,0,0.06) |
colorFillTertiary | rgba(0,0,0,0.04) |
colorPrimary | #2f54eb |
colorPrimaryBorder | #adc6ff |
colorPrimaryHover | #597ef7 |
colorText | rgba(0,0,0,0.88) |
colorTextDisabled | rgba(0,0,0,0.25) |
colorTextPlaceholder | rgba(0,0,0,0.25) |
borderRadius | 6 |
borderRadiusLG | 8 |
borderRadiusSM | 4 |
controlHeightLG | 40 |
controlOutline | rgba(5,88,255,0.06) |
controlOutlineWidth | 2 |
fontFamily | -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji' |
fontSize | 14 |
fontSizeSM | 12 |
fontWeightStrong | 600 |
lineHeight | 1.5714285714285714 |
lineHeightLG | 1.5 |
lineType | solid |
lineWidth | 1 |
margin | 16 |
marginSM | 12 |
marginXS | 8 |
marginXXS | 4 |
motionDurationMid | 0.2s |
paddingXXS | 4 |
screenLG | 992 |
screenSM | 576 |
sizeLG | 24 |
FAQ
How is current different from defaultCurrent?
defaultCurrent sets the initial local value. bind:current allows you to control it externally; pageSize works similarly.
Is recommendPage supported?
No. onChange takes two arguments. Saving the recording position when changing size is designed by the application.
Why doesn't responsive reduce elements?
The ConfigProvider's explicit size or componentSize takes precedence. Even without them, responsive switches the mini class, which in the fixed standard does not guarantee a smaller height. For a fixed result, use size:small.
Why did the quick transition disappear on the phone?
Standard CSS hides the field at a width of up to 576px. The main navigation remains.
Is it possible to change the class prefix?
Yes. Set prefixCls on Pagination or use ConfigProvider.prefixCls for the whole section. Themes, design tokens and styles for individual elements work with either option.