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: packages/documentation-site/patternfly-docs/content/components/pagination/pagination.md
+47-29Lines changed: 47 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,62 +12,80 @@ Pagination allows users to conveniently navigate through content-dense component
12
12

13
13
</div>
14
14
15
-
1.**Top pagination:** Placed above the component it controls and right-aligned.
15
+
1.**Top pagination:** Placed above the component it controls and aligned to the right.
16
16
17
-
2.**Bottom pagination:** Placed below the component it controls. Right-aligned for desktop views and center-aligned for mobile. If you want the bottom pagination to be sticky so it does not move out of view as users scroll through long content, place it directly after the component it controls and refer to the [React sticky pagination](/components/pagination#sticky) or [HTML bottom sticky pagination](/components/pagination/html#bottom-sticky) examples for further implementation guidance.
17
+
2.**Bottom pagination:** Placed below the component it controls. Right-aligned for desktop views and center-aligned for mobile. If you want bottom pagination to be sticky so that it remains in view as users scroll through long content, place it directly after the component it controls and refer to the [React sticky pagination](/components/pagination#sticky) or [HTML sticky pagination](/components/pagination/html#bottom-sticky) examples for implementation guidance.
There are 3 pagination variations you can choose from, depending on your use case:
22
+
-[Full pagination:](#full-pagination) The default component to use for most desktop views when space is not a major constraint.
23
+
-[Compact pagination:](#compact-pagination) Used for narrow spaces or as the primary control for mobile views.
24
+
-[Indeterminate pagination:](#indeterminate-pagination) Used when the total number of items is unknown.
24
25
25
26
### Full pagination
26
27
27
-
A default "full pagination" component contains multiple controls for navigating the related component. Use a full pagination unless you're restricted to a narrow workspace, in which can you should use a [compact pagination](#compact-pagination) instead.
28
-
29
-
When using full pagination a toolbar, you'll have limited room for other items like bulk selectors, buttons, filters, or input fields. You can still incorporate these additional actions with an [overflow menu](/components/toolbar/design-guidelines#overflow-menu), which will automatically form when those additional items need to collapse at specific breaking points. On mobile, full pagination will also collapse to a pagination summary with an item count. Learn how to customize overflow menu breakpoints in our [toolbar design guidelines](/components/toolbar/design-guidelines).
30
-
31
-
#### Desktop full pagination in toolbar
32
-
33
28
<divclass="ws-docs-content-img">
34
-

29
+

35
30
</div>
36
31
37
-
1.**Displayed items selector:** Allows users to choose the number of items shown at once.
32
+
1.**Per-page selector:** Used to choose the number of items displayed on a single page at once.
33
+
2.**First page/last page:** Used to jump to the first or last page of content.
34
+
3.**Previous page/next page:** Used to navigate back or forward one page of content at a time.
35
+
4.**Current page (interactive):** Displays the current location and the total number of pages of content. Users can also manually type in a page number to jump to a desired location.
38
36
39
-
2.**Full pagination:** Supplies pagination controls, including page-back and page-forward, page-first and page-last, and a manual option to type in a desired page number.
37
+
Full pagination contains a variety of controls that can be used to navigate the linked component, like a table or card view. This is the default recommendation, unless you're restricted in space or for use on mobile devices, in which case you should use [compact pagination](#compact-pagination) instead.
40
38
41
-
#### Mobile full pagination in toolbar
39
+
###Compact pagination
42
40
43
41
<divclass="ws-docs-content-img">
44
-

42
+

45
43
</div>
46
44
47
-
1.**Pagination summary:** At this screen size, the top toolbar only shows the item count to summarize the number of items currently in view. It hides all other pagination controls.
45
+
1.**Per-page selector:** Used to choose the number of items displayed on a single page at once.
46
+
2.**Previous page/next page:** Used to navigate back or forward one page of content at a time.
48
47
49
-
2.**Full pagination:** Supplies pagination controls, including page-back, page-forward, and a displayed items selector, which allows users to choose the number of items shown at once.
48
+
Compact pagination reduces visual crowding and saves space for additional actions in limited spaces, like toolbars.
50
49
51
-
The default recommendation for using pagination in mobile views is to place a pagination summary above the component it controls and a full pagination below the component, as shown in this example. If you can't use bottom pagination, or if you can't use the fall pager in the bottom toolbar for some reason, only then you can place the full pagination in the top toolbar. **Do not** use a full pagination in both the top and bottom toolbars.
50
+
### Indeterminate pagination
52
51
53
-
### Compact pagination
52
+
When it's difficult to calculate the total number of items or page count upfront, you can use an indeterminate pagination, which replaces the total page number in the per-page selector with a general label of “many”. Users can still choose the number of items shown at once, and the indeterminate label can be used within both full and compact pagination components.
53
+
54
+
<divclass="ws-docs-content-img">
55
+

56
+
</div>
54
57
55
-
Compact pagination saves space for additional actions in limited spaces, like toolbars, and can help reduce visual crowding. Like with full pagination, compact pagination condenses to a pagination summary for mobile views.
58
+
## Placement
56
59
57
-
#### Desktop compact pagination in toolbar
60
+
### Desktop
61
+
62
+
For desktop views, place a full pagination component above the content it controls, typically within a toolbar.
58
63
59
64
<divclass="ws-docs-content-img">
60
-

65
+

61
66
</div>
62
67
63
-
1.**Displayed items selector:**Allows users to choose the number of items shown at once.
68
+
1.**Per-page selector:** Used to choose the number of items displayed on a single page at once.
64
69
65
-
2.**Compact pagination:** Supplies pagination controls, including page-back and page-next controls.
70
+
2.**Full pagination:** Supplies data navigation controls, including previous page and next page, first page and last page, and a manual option to type in a desired page number.
66
71
67
-
### Indeterminate pagination
72
+
When used in a toolbar, pagination may leave limited room for other items like filters or bulk selectors. These additional items will automatically move into an [overflow menu](/components/toolbar/design-guidelines#overflow-menu) as needed.
73
+
74
+
For components with long, scrolling content (like a table), you can add a second full pagination component below the content to ensure that users can navigate without having to scroll back to the top.
75
+
76
+
### Mobile
68
77
69
-
Use indeterminate pagination if it’s difficult to calculate the total number of items or page count upfront. In these cases, you use “many” instead of a specific page count that would otherwise appear. Users can still select this control to choose the number of items shown at once.
78
+
Mobile pagination is formatted differently in order to conserve space. On mobile, full pagination will collapse to a pagination summary with an item count. [Learn how to customize overflow menu breakpoints in our toolbar design guidelines](/components/toolbar/design-guidelines).
70
79
71
80
<divclass="ws-docs-content-img">
72
-

73
-
</div>
81
+

82
+
</div>
83
+
84
+
1.**Pagination summary:** A non-interactive count of items currently displayed.
85
+
86
+
2.**Mobile pagination:** A type of compact pagination, with a previous page, next page, and a per-page selector, which allows users to choose the number of items shown at once. Mobile views use compact styling, which removes the first page and last page controls.
87
+
88
+
When using pagination in mobile views, follow these best practices:
89
+
- As shown in this example, place a pagination summary above the component it controls and a mobile pagination below the component.
90
+
- Do not use full pagination in both the top and bottom toolbars.
91
+
- If you can't use bottom pagination, or if you can't use the compact pagination in the bottom toolbar for some reason, only then you can place the compact pagination in the top toolbar.
0 commit comments