← All Components
<mth-pagination>
Accessible numbered pagination landmark with localized labels, ellipsis collapsing, and aria-current="page".
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-pagination>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/pagination"></script>
<mth-pagination page="1" total-pages="1"></mth-pagination>import '@methane-ui/ui/pagination';
import '@methane-ui/react';
export function Example() {
return <mth-pagination page="1" total-pages="1"></mth-pagination>;
}<script setup lang="ts">
import '@methane-ui/ui/pagination';
</script>
<template>
<mth-pagination page="1" total-pages="1"></mth-pagination>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/pagination';
import { MthPaginationDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthPaginationDirective],
template: `<mth-pagination page="1" total-pages="1"></mth-pagination>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/pagination';
import MthPagination from '@methane-ui/svelte/MthPagination.svelte';
</script>
<MthPagination page="1" total-pages="1"></MthPagination>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
page | page | number | 1 | Current 1-indexed active page. |
totalPages | total-pages | number | 1 | Total number of available pages. |
siblingCount | sibling-count | number | 1 | Number of sibling pages rendered around the active page. |
boundaryCount | boundary-count | number | 1 | Number of boundary pages pinned at the start and end. |
disabled | disabled | boolean | false | Disables all pagination buttons. |
label | label | string | "" | Custom accessible aria-label for <nav>. |
Events
| Event | Detail Type | Description |
|---|---|---|
mth-change | { page: number } | Emitted when the active page changes. |
APG Keyboard Matrix
| Key | Direction | When | Expected Behavior |
|---|---|---|---|
| Enter | both | Page, previous, or next button is focused | Navigates to the target page and emits mth-change |
both | Page, previous, or next button is focused | Navigates to the target page and emits mth-change |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | delegatesFocus: true with zero host internals.role (ADR-014). | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| keyboard | Implements all 2 APG keyboard transitions across LTR/RTL. | mth-pagination.spec.test.ts |
| states | Exposes ElementInternals CustomStateSet flags: :state(disabled). | Conformance suite |
| i18n | Routes 4 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |