You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/next-docs/content/components/Pagination/index.mdx
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,17 +69,35 @@ render(<App />)
69
69
/>
70
70
```
71
71
72
+
### Custom button labels
73
+
74
+
Use the `labels` prop to customize the visible text of the previous and next controls. When localizing content, remember to also set the matching `prevAriaLabel` and `nextAriaLabel` labels so that the accessible names stay in sync with the visible text.
75
+
76
+
```jsx live
77
+
<Pagination
78
+
pageCount={3}
79
+
currentPage={2}
80
+
labels={{
81
+
prev:'Précédent',
82
+
next:'Suivant',
83
+
prevAriaLabel:'Page précédente',
84
+
nextAriaLabel:'Page suivante',
85
+
}}
86
+
/>
87
+
```
88
+
72
89
## Component props
73
90
74
91
### Pagination <Label>Required</Label>
75
92
76
-
| name | type | default | required | description |
|`marginPageCount`|`number`||`false`| Defines how many pages are to be displayed on the left and right of the component. Will be reduced on narrow viewports. |
84
-
|`showPages`|`boolean`||`false`| Whether to show the page numbers |
85
-
|`surroundingPageCount`|`number`||`false`| The number of pages to show on each side of the current page. Will be hidden on narrow viewports. |
93
+
| name | type | default | required | description |
|`marginPageCount`|`number`||`false`| Defines how many pages are to be displayed on the left and right of the component. Will be reduced on narrow viewports. |
101
+
|`showPages`|`boolean`||`false`| Whether to show the page numbers |
102
+
|`surroundingPageCount`|`number`||`false`| The number of pages to show on each side of the current page. Will be hidden on narrow viewports. |
103
+
|`labels`|`{prev?: string; next?: string; prevAriaLabel?: string; nextAriaLabel?: string}`||`false`| Custom text and accessible labels for the previous and next controls. Provide any subset. |
0 commit comments