Anatomy
aegov-pagination renders a single <nav> landmark wrapping a <ul> of buttons: Previous, an optional First before it and Last after Next, page-number buttons with ellipsis tokens between distant ranges (or, in compact mode, a plain "page X of Y" text indicator instead of page numbers).

| Item | Name | Description |
|---|---|---|
1 |
Nav landmark | The <nav> element, labelled "Pagination" |
2 |
Previous / Next | Always rendered; disabled at the first/last page |
3 |
First / Last | Optional, shown only when is-enabled-first-last is set |
4 |
Page button | One per visible page number; the active one carries aria-current="page" |
5 |
Ellipsis | Decorative, marks a collapsed range of hidden page numbers |
Basic pagination
aegov-pagination is controlled: when the user clicks a page, the component only emits aegovPaginationPageChange with the new page number — your application must update page-current in response (and load the data for that page). Without wiring this event, clicking a page button has no visible effect at all.
<aegov-pagination id="pager" pages="10" page-current="1"></aegov-pagination>
<script>
const pager = document.getElementById('pager');
pager.addEventListener('aegovPaginationPageChange', (e) => {
pager.pageCurrent = e.detail;
// load data for the new page…
});
</script>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationBasics() {
const [page, setPage] = useState(1);
return (
<AegovPagination
pages={10}
pageCurrent={page}
onAegovPaginationPageChange={(e) => setPage(e.detail)}
/>
);
}
<template>
<aegov-pagination
:pages="10"
:page-current="page"
@aegovPaginationPageChange="page = $event.detail"
></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(1);
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-basics',
imports: [AegovPagination],
template: `
<aegov-pagination [pages]="10" [pageCurrent]="page" (aegovPaginationPageChange)="page = $event.detail"></aegov-pagination>
`,
})
export class PaginationBasicsComponent {
page = 1;
}
Total pages and current page
pages is the total page count and page-current is the active page (1-indexed) — both drive the render. When pages is 1, Previous and Next are disabled and a single page-1 button remains as the current-page indicator. When pages is 0 or less, the component renders nothing at all.
<aegov-pagination pages="6" page-current="3"></aegov-pagination>
<aegov-pagination pages="1" page-current="1"></aegov-pagination>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationPagesCurrent() {
const [page, setPage] = useState(3);
return (
<>
<AegovPagination pages={6} pageCurrent={page} onAegovPaginationPageChange={(e) => setPage(e.detail)} />
<AegovPagination pages={1} pageCurrent={1} />
</>
);
}
<template>
<aegov-pagination :pages="6" :page-current="page" @aegovPaginationPageChange="page = $event.detail"></aegov-pagination>
<aegov-pagination :pages="1" :page-current="1"></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(3);
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-pages-current',
imports: [AegovPagination],
template: `
<aegov-pagination [pages]="6" [pageCurrent]="page" (aegovPaginationPageChange)="page = $event.detail"></aegov-pagination>
<aegov-pagination [pages]="1" [pageCurrent]="1"></aegov-pagination>
`,
})
export class PaginationPagesCurrentComponent {
page = 3;
}
First and Last buttons
Set is-enabled-first-last="true" to show explicit First and Last buttons alongside Previous and Next — useful for very long lists where a user wants to jump straight to either end.
<aegov-pagination pages="50" page-current="12" is-enabled-first-last="true"></aegov-pagination>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationFirstLast() {
const [page, setPage] = useState(12);
return (
<AegovPagination
pages={50}
pageCurrent={page}
isEnabledFirstLast
onAegovPaginationPageChange={(e) => setPage(e.detail)}
/>
);
}
<template>
<aegov-pagination
:pages="50"
:page-current="page"
is-enabled-first-last="true"
@aegovPaginationPageChange="page = $event.detail"
></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(12);
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-first-last',
imports: [AegovPagination],
template: `
<aegov-pagination
[pages]="50"
[pageCurrent]="page"
[isEnabledFirstLast]="true"
(aegovPaginationPageChange)="page = $event.detail"
></aegov-pagination>
`,
})
export class PaginationFirstLastComponent {
page = 12;
}
Sibling and boundary counts
count-sibling controls how many pages appear on each side of the current page; count-boundary controls how many pages always stay visible at the start and end. Both default to 1. Increase them when there's plenty of horizontal space and users benefit from seeing more surrounding context.
Default (1 sibling, 1 boundary)
2 siblings each side
2 siblings + 2 boundary pages
<aegov-pagination pages="50" page-current="20"></aegov-pagination>
<aegov-pagination pages="50" page-current="20" count-sibling="2"></aegov-pagination>
<aegov-pagination pages="50" page-current="20" count-sibling="2" count-boundary="2"></aegov-pagination>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationSiblingBoundary() {
const [page, setPage] = useState(20);
const onChange = (e: CustomEvent<number>) => setPage(e.detail);
return (
<>
<AegovPagination pages={50} pageCurrent={page} onAegovPaginationPageChange={onChange} />
<AegovPagination pages={50} pageCurrent={page} countSibling={2} onAegovPaginationPageChange={onChange} />
<AegovPagination pages={50} pageCurrent={page} countSibling={2} countBoundary={2} onAegovPaginationPageChange={onChange} />
</>
);
}
<template>
<aegov-pagination :pages="50" :page-current="page" @aegovPaginationPageChange="onChange"></aegov-pagination>
<aegov-pagination :pages="50" :page-current="page" :count-sibling="2" @aegovPaginationPageChange="onChange"></aegov-pagination>
<aegov-pagination :pages="50" :page-current="page" :count-sibling="2" :count-boundary="2" @aegovPaginationPageChange="onChange"></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(20);
function onChange(e) { page.value = e.detail; }
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-sibling-boundary',
imports: [AegovPagination],
template: `
<aegov-pagination [pages]="50" [pageCurrent]="page" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
<aegov-pagination [pages]="50" [pageCurrent]="page" [countSibling]="2" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
<aegov-pagination [pages]="50" [pageCurrent]="page" [countSibling]="2" [countBoundary]="2" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
`,
})
export class PaginationSiblingBoundaryComponent {
page = 20;
onChange(e: CustomEvent<number>) { this.page = e.detail; }
}
Compact variant
variant="compact" hides individual page numbers and shows only Previous, Next, and a "page X of Y" indicator — the recommended layout for narrow viewports and sidebars. The indicator sits inside a polite aria-live region, so assistive technology announces the new position whenever the page changes.
<aegov-pagination variant="compact" pages="20" page-current="3"></aegov-pagination>
<aegov-pagination variant="compact" pages="20" page-current="3" is-enabled-first-last="true"></aegov-pagination>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationCompact() {
const [page, setPage] = useState(3);
const onChange = (e: CustomEvent<number>) => setPage(e.detail);
return (
<>
<AegovPagination variant="compact" pages={20} pageCurrent={page} onAegovPaginationPageChange={onChange} />
<AegovPagination variant="compact" pages={20} pageCurrent={page} isEnabledFirstLast onAegovPaginationPageChange={onChange} />
</>
);
}
<template>
<aegov-pagination variant="compact" :pages="20" :page-current="page" @aegovPaginationPageChange="onChange"></aegov-pagination>
<aegov-pagination variant="compact" :pages="20" :page-current="page" is-enabled-first-last="true" @aegovPaginationPageChange="onChange"></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(3);
function onChange(e) { page.value = e.detail; }
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-compact',
imports: [AegovPagination],
template: `
<aegov-pagination variant="compact" [pages]="20" [pageCurrent]="page" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
<aegov-pagination variant="compact" [pages]="20" [pageCurrent]="page" [isEnabledFirstLast]="true" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
`,
})
export class PaginationCompactComponent {
page = 3;
onChange(e: CustomEvent<number>) { this.page = e.detail; }
}
Sizes
size accepts sm, base (default), and lg.
<aegov-pagination size="sm" pages="10" page-current="3"></aegov-pagination>
<aegov-pagination size="base" pages="10" page-current="3"></aegov-pagination>
<aegov-pagination size="lg" pages="10" page-current="3"></aegov-pagination>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationSizes() {
const [page, setPage] = useState(3);
const onChange = (e: CustomEvent<number>) => setPage(e.detail);
return (
<>
<AegovPagination size="sm" pages={10} pageCurrent={page} onAegovPaginationPageChange={onChange} />
<AegovPagination size="base" pages={10} pageCurrent={page} onAegovPaginationPageChange={onChange} />
<AegovPagination size="lg" pages={10} pageCurrent={page} onAegovPaginationPageChange={onChange} />
</>
);
}
<template>
<aegov-pagination size="sm" :pages="10" :page-current="page" @aegovPaginationPageChange="onChange"></aegov-pagination>
<aegov-pagination size="base" :pages="10" :page-current="page" @aegovPaginationPageChange="onChange"></aegov-pagination>
<aegov-pagination size="lg" :pages="10" :page-current="page" @aegovPaginationPageChange="onChange"></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(3);
function onChange(e) { page.value = e.detail; }
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-sizes',
imports: [AegovPagination],
template: `
<aegov-pagination size="sm" [pages]="10" [pageCurrent]="page" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
<aegov-pagination size="base" [pages]="10" [pageCurrent]="page" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
<aegov-pagination size="lg" [pages]="10" [pageCurrent]="page" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
`,
})
export class PaginationSizesComponent {
page = 3;
onChange(e: CustomEvent<number>) { this.page = e.detail; }
}
Responsive sizes
size also accepts a Tailwind-style responsive string. Each segment overrides smaller breakpoints, so the example below is sm on phones, base from the md breakpoint up, and lg from lg up.
<aegov-pagination size="sm md:base lg:lg" pages="20" page-current="3"></aegov-pagination>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationResponsiveSizes() {
const [page, setPage] = useState(3);
return (
<AegovPagination
size="sm md:base lg:lg"
pages={20}
pageCurrent={page}
onAegovPaginationPageChange={(e) => setPage(e.detail)}
/>
);
}
<template>
<aegov-pagination size="sm md:base lg:lg" :pages="20" :page-current="page" @aegovPaginationPageChange="page = $event.detail"></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(3);
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-responsive-sizes',
imports: [AegovPagination],
template: `
<aegov-pagination size="sm md:base lg:lg" [pages]="20" [pageCurrent]="page" (aegovPaginationPageChange)="page = $event.detail"></aegov-pagination>
`,
})
export class PaginationResponsiveSizesComponent {
page = 3;
}
Disabled state
Set is-disabled="true" to disable every button. The current page is still announced to assistive technology, but no click emits an event — typical uses are freezing the pager while data loads, or after a server error.
<aegov-pagination pages="10" page-current="3" is-disabled="true"></aegov-pagination>
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationDisabled() {
return <AegovPagination pages={10} pageCurrent={3} isDisabled />;
}
<template>
<aegov-pagination :pages="10" :page-current="3" is-disabled="true"></aegov-pagination>
</template>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-disabled',
imports: [AegovPagination],
template: `<aegov-pagination [pages]="10" [pageCurrent]="3" [isDisabled]="true"></aegov-pagination>`,
})
export class PaginationDisabledComponent {}
Custom labels for localization
Override the visible button text with label-prev, label-next, label-first, and label-last. The built-in defaults are already bilingual (English/Arabic, auto-selected from the page direction) — reach for these props only when you need bespoke wording rather than a straight translation.
<aegov-pagination
pages="20"
page-current="5"
is-enabled-first-last="true"
label-prev="Back"
label-next="Forward"
label-first="Start"
label-last="End"
></aegov-pagination>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function PaginationLabels() {
const [page, setPage] = useState(5);
return (
<AegovPagination
pages={20}
pageCurrent={page}
isEnabledFirstLast
labelPrev="Back"
labelNext="Forward"
labelFirst="Start"
labelLast="End"
onAegovPaginationPageChange={(e) => setPage(e.detail)}
/>
);
}
<template>
<aegov-pagination
:pages="20"
:page-current="page"
is-enabled-first-last="true"
label-prev="Back"
label-next="Forward"
label-first="Start"
label-last="End"
@aegovPaginationPageChange="page = $event.detail"
></aegov-pagination>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(5);
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-labels',
imports: [AegovPagination],
template: `
<aegov-pagination
[pages]="20"
[pageCurrent]="page"
[isEnabledFirstLast]="true"
labelPrev="Back"
labelNext="Forward"
labelFirst="Start"
labelLast="End"
(aegovPaginationPageChange)="page = $event.detail"
></aegov-pagination>
`,
})
export class PaginationLabelsComponent {
page = 5;
}
Practical example: service tickets list
Combining the pager with a results region. The change event updates page-current and rewrites the visible record range — in a real service this is where you would call your API for the next batch of records.
My service requests
Showing records 1 – 10 of 47
- SR-2026-0001 — Vehicle registration renewal
- SR-2026-0002 — Family residence visa
- SR-2026-0003 — Trade licence amendment
<div id="tickets" class="p-6 border border-aeblack-200 rounded-lg">
<h3 class="text-lg font-semibold mb-4">My service requests</h3>
<p class="text-aeblack-500 mb-4">Showing records <span id="tickets-range">1 – 10</span> of 47</p>
<ul class="text-aeblack-700 list-disc ms-5">
<li>SR-2026-0001 — Vehicle registration renewal</li>
<li>SR-2026-0002 — Family residence visa</li>
<li>SR-2026-0003 — Trade licence amendment</li>
</ul>
</div>
<div class="mt-4">
<aegov-pagination id="tickets-pager" pages="5" page-current="1" count-sibling="1"></aegov-pagination>
</div>
<script>
const total = 47;
const perPage = 10;
const pager = document.getElementById('tickets-pager');
const rangeEl = document.getElementById('tickets-range');
pager.addEventListener('aegovPaginationPageChange', (e) => {
pager.pageCurrent = e.detail;
const start = (e.detail - 1) * perPage + 1;
const end = Math.min(e.detail * perPage, total);
rangeEl.textContent = `${start} – ${end}`;
});
</script>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
const TOTAL = 47;
const PER_PAGE = 10;
export default function PaginationServiceTickets() {
const [page, setPage] = useState(1);
const start = (page - 1) * PER_PAGE + 1;
const end = Math.min(page * PER_PAGE, TOTAL);
return (
<>
<div className="p-6 border border-aeblack-200 rounded-lg">
<h3 className="text-lg font-semibold mb-4">My service requests</h3>
<p className="text-aeblack-500 mb-4">Showing records {start} – {end} of {TOTAL}</p>
<ul className="text-aeblack-700 list-disc ms-5">
<li>SR-2026-0001 — Vehicle registration renewal</li>
<li>SR-2026-0002 — Family residence visa</li>
<li>SR-2026-0003 — Trade licence amendment</li>
</ul>
</div>
<div className="mt-4">
<AegovPagination pages={5} pageCurrent={page} countSibling={1} onAegovPaginationPageChange={(e) => setPage(e.detail)} />
</div>
</>
);
}
<template>
<div class="p-6 border border-aeblack-200 rounded-lg">
<h3 class="text-lg font-semibold mb-4">My service requests</h3>
<p class="text-aeblack-500 mb-4">Showing records {{ start }} – {{ end }} of {{ total }}</p>
<ul class="text-aeblack-700 list-disc ms-5">
<li>SR-2026-0001 — Vehicle registration renewal</li>
<li>SR-2026-0002 — Family residence visa</li>
<li>SR-2026-0003 — Trade licence amendment</li>
</ul>
</div>
<div class="mt-4">
<aegov-pagination :pages="5" :page-current="page" :count-sibling="1" @aegovPaginationPageChange="page = $event.detail"></aegov-pagination>
</div>
</template>
<script setup>
import { ref, computed } from 'vue';
const total = 47;
const perPage = 10;
const page = ref(1);
const start = computed(() => (page.value - 1) * perPage + 1);
const end = computed(() => Math.min(page.value * perPage, total));
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-pagination-service-tickets',
imports: [AegovPagination],
template: `
<div class="p-6 border border-aeblack-200 rounded-lg">
<h3 class="text-lg font-semibold mb-4">My service requests</h3>
<p class="text-aeblack-500 mb-4">Showing records {{ start }} – {{ end }} of {{ total }}</p>
<ul class="text-aeblack-700 list-disc ms-5">
<li>SR-2026-0001 — Vehicle registration renewal</li>
<li>SR-2026-0002 — Family residence visa</li>
<li>SR-2026-0003 — Trade licence amendment</li>
</ul>
</div>
<div class="mt-4">
<aegov-pagination [pages]="5" [pageCurrent]="page" [countSibling]="1" (aegovPaginationPageChange)="onChange($event)"></aegov-pagination>
</div>
`,
})
export class PaginationServiceTicketsComponent {
total = 47;
perPage = 10;
page = 1;
get start() { return (this.page - 1) * this.perPage + 1; }
get end() { return Math.min(this.page * this.perPage, this.total); }
onChange(e: CustomEvent<number>) {
this.page = e.detail;
}
}
RTL support
The control is direction-agnostic — it reads dir="rtl" from the closest ancestor carrying a dir attribute (or the document root). In RTL mode the Previous/Next/First/Last chevrons mirror automatically, the list flows right-to-left, and the built-in labels switch to their Arabic strings.
<div dir="rtl">
<aegov-pagination
pages="12"
page-current="4"
is-enabled-first-last="true"
></aegov-pagination>
</div>
import { useState } from 'react';
import { AegovPagination } from '@aegov/designsystem-react';
export default function RtlPagination() {
const [page, setPage] = useState(4);
return (
<div dir="rtl">
<AegovPagination
pages={12}
pageCurrent={page}
isEnabledFirstLast
onAegovPaginationPageChange={(e) => setPage(e.detail)}
/>
</div>
);
}
<template>
<div dir="rtl">
<aegov-pagination
:pages="12"
:page-current="page"
is-enabled-first-last="true"
@aegovPaginationPageChange="page = $event.detail"
></aegov-pagination>
</div>
</template>
<script setup>
import { ref } from 'vue';
const page = ref(4);
</script>
import { Component } from '@angular/core';
import { AegovPagination } from '@aegov/designsystem-angular';
@Component({
selector: 'app-rtl-pagination',
imports: [AegovPagination],
template: `
<div dir="rtl">
<aegov-pagination
[pages]="12"
[pageCurrent]="page"
[isEnabledFirstLast]="true"
(aegovPaginationPageChange)="page = $event.detail"
></aegov-pagination>
</div>
`,
})
export class RtlPaginationComponent {
page = 4;
}
Usage
Here is the recommended usage of pagination on any website or application. These are recommended usage guides, however the developer must use the best practices of web and application development to accurately use this component.
Always update page-current in response to aegovPaginationPageChange
The component is fully controlled — without the update, a click has no visible effect at all. Update the property, then load the data for the new page.
Move focus or scroll position after a page change
A keyboard user who just activated "Next" is still focused on that button — if the results region is far away or replaced entirely, they can lose their place. Move focus to (or scroll to) the updated content.
Reach for the compact variant on narrow viewports
Letting individual page-number buttons wrap onto a second line on a small screen is harder to scan than a single "Page 3 of 10" indicator with Previous/Next either side.
Don't forget is-enabled-first-last on very long lists
Past roughly 50 pages, jumping from page 1 to page 50 by clicking Next dozens of times is a real usability problem — enable explicit First/Last buttons.
Rename the landmark when a page has more than one pager
An aria-label set on <aegov-pagination> is forwarded to the inner <nav> and replaces the built-in "Pagination" label — for example aria-label="Search results pages" — so screen-reader users can tell several pagination landmarks apart.
Don't set count-sibling/count-boundary so high that ellipsis never appears on a long list
The whole point of the collapsed range is to keep the control compact — pushing the counts up until every page number is always visible defeats that, and on a narrow layout the row will simply wrap.
API reference
The following are the properties and references of a pagination control
Properties
| Attribute | Description | Type | Default |
|---|---|---|---|
| DOM |
| auto-generated |
| Total number of pages. The component renders nothing when |
|
|
| Currently active page (1-indexed). This is a controlled prop — update it in response to every |
|
|
| Show explicit First and Last buttons alongside Previous and Next. |
|
|
| Number of sibling pages shown on each side of the current page. |
|
|
| Number of pages always visible at each boundary (start and end of the list). |
|
|
|
|
|
|
| Size token, or a Tailwind-style responsive string. |
|
|
| Disables every button. The current page is still announced to assistive technology, but no click emits an event. |
|
|
| Visible label on the Previous button. Empty falls back to a localized string ("Previous"/"السابق"). |
|
|
| Visible label on the Next button. Empty falls back to a localized string ("Next"/"التالي"). |
|
|
| Visible label on the First button (only shown when |
|
|
| Visible label on the Last button (only shown when |
|
|
Slots
| Note |
|---|
This component exposes no slots — its entire layout is driven by props. |
Events
| Event | Detail | Description |
|---|---|---|
|
| Fired when the user clicks a navigation or page button. The detail is the new 1-indexed page. Not emitted for the current page, for a page outside |
Pass-through attributes
| Attribute group | Forwarded? | Where applied |
|---|---|---|
| Yes | The inner |
| Allowed | The host element. |
| Not forwarded | Use |
Notes
The following notes are applicable of this component.
Built-in accessibility
- Renders as a
<nav>landmark witharia-label="Pagination"(Arabic: "ترقيم الصفحات") so screen readers announce it among page landmarks. - The active page button carries
aria-current="page"and a descriptivearia-labelsuch as "Page 3, current page" (Arabic: "الصفحة 3، الصفحة الحالية"). - Previous, Next, First, and Last buttons are named by their visible text: the built-in bilingual label ("Previous", "Next", "First", "Last"; Arabic "السابق", "التالي", "الأول", "الأخير" when
dir="rtl"is detected) or yourlabel-*value. Their chevron icons arearia-hidden. - The compact variant's position indicator ("Page 3 of 10" / "الصفحة 3 من 10") sits in a polite
aria-liveregion, announced whenever the page changes. - Disabled buttons set both the native
disabledattribute andaria-disabled="true". - Ellipsis tokens are
aria-hidden="true"— decorative only, never announced.
Developer responsibilities
- Always update
page-currentin response toaegovPaginationPageChange— the component never updates its own state; without the update, clicking does nothing. - After a page change, move focus to (or scroll to) the updated content region so keyboard users don't lose their place — the button just activated may become disabled (e.g. Next on the last page) and drop focus.
- In the
defaultvariant there is no live region, so announce the new result range yourself (e.g. anaria-live="polite"summary next to the results). - Prefer
compacton narrow viewports rather than letting page-number buttons wrap onto a second line. - Enable
is-enabled-first-laston lists beyond roughly 50 pages, so users can reach either end without repeatedly clicking Next. label-*props set both the visible text and the accessible name, so voice-control users can say what they see (WCAG 2.2 SC 2.5.3 Label in Name). Keep custom labels short and clear, e.g. "Previous page".- Never hide
.pagination__nav-labelwithdisplay: noneorvisibility: hidden: that text is the button's only name. To show just the chevrons on small screens, hide the text visually (a screen-reader-only style) so it is still read out.
Keyboard support
| Key | Action |
|---|---|
Tab |
Move focus to the next pagination button. Disabled buttons are skipped. |
Shift + Tab |
Move focus to the previous pagination button. |
Enter, Space |
Activate the focused button. |
Notes
- An unrecognised
variantfalls back todefaultand logs a console warning in development builds only; an unrecognisedsizetoken falls back tobasesilently. - Setting
count-sibling/count-boundaryhigh enough that every page number always fits removes the ellipsis entirely — this is expected, not a bug: the algorithm only collapses a range when doing so would hide two or more page numbers.