Skip to content

Commit 735f1b6

Browse files
fix(pagination): make navigation aria-label customizable for i18n
1 parent 0e50f46 commit 735f1b6

3 files changed

Lines changed: 7 additions & 54 deletions

File tree

.changeset/eleven-radios-work.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
fix(pagination): add ARIA attributes for screen reader accessibility
66

7-
Wrapped pagination controls in `<nav aria-label="Pagination">` for proper landmark navigation. Added `aria-live="polite"` and `aria-atomic="true"` to the "Showing X-Y of Z" text so screen readers announce page changes.
7+
- Wrap pagination controls in `<nav>` for proper landmark navigation
8+
- Add `aria-live="polite"` and `aria-atomic="true"` to status text for page change announcements
9+
- Add `navigation` to `PaginationLabels` for i18n customization of the nav aria-label

.changeset/pagination-a11y-i18n.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

packages/kumo/src/components/pagination/pagination.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ const clamp = (value: number, min: number, max: number) =>
3535
* `label` prop on `Pagination.PageSize`.
3636
*/
3737
export interface PaginationLabels {
38+
/** Aria label for the navigation landmark. @default "Pagination" */
39+
navigation?: string;
3840
/** Aria label for the first page button. @default "First page" */
3941
firstPage?: string;
4042
/** Aria label for the previous page button. @default "Previous page" */
@@ -50,6 +52,7 @@ export interface PaginationLabels {
5052
}
5153

5254
const DEFAULT_LABELS: Required<PaginationLabels> = {
55+
navigation: "Pagination",
5356
firstPage: "First page",
5457
previousPage: "Previous page",
5558
nextPage: "Next page",
@@ -247,7 +250,7 @@ function PaginationControls({
247250
data-slot="pagination-controls"
248251
className={cn("grow flex flex-col items-end", className)}
249252
>
250-
<nav aria-label="Pagination">
253+
<nav aria-label={labels.navigation}>
251254
<InputGroup focusMode="individual">
252255
{controls === "full" && (
253256
<InputGroup.Button

0 commit comments

Comments
 (0)