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/design-guidelines/components/data-list/data-list.md
+39-13Lines changed: 39 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,15 @@ section: components
4
4
related: ['Table']
5
5
---
6
6
7
+
import '../components.css';
8
+
7
9
## Elements
10
+
8
11
The elements mentioned below are similar for a data list with compact or default spacing. This example shows a data list with compact spacing.
9
12
10
-
<imgsrc="./img/datalist-elements.png"alt="example of elements on a data list"width="1273"/>
13
+
<divclass="ws-docs-content-img">
14
+

15
+
</div>
11
16
12
17
1.**[Toolbar](/components/toolbar/design-guidelines):** Sits above the list and contains controls for manipulating list data. Common actions include filtering, sorting, and pagination.
13
18
2.**[Bulk selection](/patterns/bulk-selection):** When present, selects all items in a table. If pagination is being used, this will only select items on the current page. See [bulk selection](/patterns/bulk-selection) for more information.
@@ -20,6 +25,7 @@ The elements mentioned below are similar for a data list with compact or default
20
25
21
26
22
27
## Usage
28
+
23
29
Think of each row in a data list as a container for some formatted content. In PatternFly, data list rows can accept any [layout](/layouts/bullseye) supported by the design system as long as all rows apply the same layout. Here are some common layouts that may be useful in a data list:
24
30
25
31
***[Grid](/layouts/grid):** Displays content in a responsive grid.
@@ -42,14 +48,17 @@ Data lists can also appear in primary-detail views. Visit the [primary-detail gu
42
48
* The clarity of your content would benefit from well defined columns and headings.
43
49
44
50
## Variations
51
+
45
52
PatterFly supports 2 main types of data lists:
46
53
47
54
1.**[Compact data list](#compact-spacing):** Use when you want to show as much data per page as possible.
48
55
2.**[Default data list](#default-spacing):** Use when you don’t have to minimize paging.
49
56
50
57
See [when to use compact vs. default spacing](#when-to-use-a-data-list-vs.-a-table)for more information about the styling and usage.
51
58
52
-
<imgsrc="./img/compact-and-default-list.png"alt="Compact and default data list" />
59
+
<divclass="ws-docs-content-img">
60
+

61
+
</div>
53
62
54
63
### Data list capabilities
55
64
Every data list can be extended with these functionalities:
@@ -62,7 +71,9 @@ Every data list can be extended with these functionalities:
62
71
### Selectable data list
63
72
The selectable data list provides checkboxes that enable users to select one or more rows in the list. Users may then act on those selections using options in the [toolbar](/components/toolbar/design-guidelines).
64
73
65
-
<imgsrc="./img/datalist-selectable.png"alt="example of selectable data list"width="1214"/>
74
+
<divclass="ws-docs-content-img">
75
+

76
+
</div>
66
77
67
78
1.**[Bulk selection](/patterns/bulk-selection):** When present, selects all items in a table. If pagination is being used, this will only select items on the current page. See [bulk selection](/patterns/bulk-selection) for more information.
68
79
2.**Checkbox:** Enables a user to select a row.
@@ -77,7 +88,9 @@ The selectable data list provides checkboxes that enable users to select one or
77
88
### Clickable data list
78
89
The clickable data list can be used when data lists need to provide additional information while keeping the row information available via a primary-detail drawer. This can be done by clicking on the row itself.
79
90
80
-
<imgsrc="./img/datalist-clickable.png"alt="example of clickable data list"width="2606"/>
91
+
<divclass="ws-docs-content-img">
92
+

93
+
</div>
81
94
82
95
1.**Row:** Enables the user to click on the row to trigger the action of opening a primary-detail drawer
83
96
2.**Primary-detail:** Additional drawer of information that allows the user to still see the data list
@@ -90,7 +103,9 @@ The clickable data list can be used when data lists need to provide additional i
90
103
### Expandable data list
91
104
The expandable list adds an expansion panel to every row to reveal more details about the item.
92
105
93
-
<imgsrc="./img/datalist-expandable.png"alt="example of expandable data list"width="1273"/>
106
+
<divclass="ws-docs-content-img">
107
+

108
+
</div>
94
109
95
110
1.**Expand all (optional):** Expands or collapses every row in the data list at the same time.
96
111
2.**Expansion caret:** Toggles the expansion open and closed for the individual row.
@@ -103,23 +118,37 @@ The expandable list adds an expansion panel to every row to reveal more details
103
118
* You want to provide a way for advanced users to access information that is not applicable to all users.
104
119
105
120
### Draggable data list rows
106
-
107
121
Draggable data list rows can be added to any data list and allow you to customize the order of rows within a data list.
108
122
109
-
<imgsrc="./img/datalist-draggable1.png"alt="example of draggable data list"width="1011"/>
110
-
111
123
1.**Drag icon:** To indicate a row is draggable, use the fa-grip icon. Use grip-vertical to indicate the ability to move a vertically-oriented component via drag and drop. Use grip-horizontal to move a horizontally-oriented component via drag and drop. For example, if you are selecting items to be dragged from two parallel lists.
124
+
125
+
<divclass="ws-docs-content-img">
126
+

127
+
</div>
128
+
112
129
2.**Dragged row:** When dragging a row, it becomes slightly less opaque and floats above the static rows to indicate that it is the one moving.
113
130
114
-
<imgsrc="./img/datalist-draggable2.png"alt="example of draggable data list"width="1006"/>
131
+
<divclass="ws-docs-content-img">
132
+

133
+
</div>
115
134
116
135
3.**Dragged row positioning:** When positioning the row, the other elements in the data list will move to indicate the dragged row’s position.
136
+
137
+
<divclass="ws-docs-content-img">
138
+

139
+
</div>
140
+
117
141
4.**Final position:** After the row has been placed where desired, the data list becomes static again, until the user decides to drag another row.
118
142
143
+
<divclass="ws-docs-content-img">
144
+

145
+
</div>
146
+
119
147
#### When to use
120
148
Use draggable data list rows when you want to allow users to order their choices within a list. A common example of this is [column management](/components/table/react-demos#column-management-with-draggable). Users can choose the number of columns and the order they are shown in a table by selecting and dragging rows in the **Manage columns** modal. Another common use case is ordering the importance of roles or types relative to a resource.
121
149
122
150
## Spacing
151
+
123
152
Whether to use a data list with compact or default spacing is up to you and your use case. However, here is some guidance for when to use which option. You can see examples of each option for comparison.
124
153
125
154
### Compact spacing
@@ -131,8 +160,6 @@ A data list may sometimes need to be compact to make more rows visible at a time
131
160
* You need to minimize paging.
132
161
* Readability is a secondary concern.
133
162
134
-
<imgsrc="./img/compact-datalist.png"alt="Example of compact spacing data list"width="990"/>
135
-
136
163
**Example:**
137
164
* You can see more data on one page.
138
165
* You have a good overview about the structure of data.
@@ -147,12 +174,11 @@ A data list may sometimes need more space for rich graphical data. See an exampl
147
174
* You don't have to minimize paging.
148
175
* Readability is a primary concern.
149
176
150
-
<imgsrc="./img/default-datalist.png"alt="Example of default spacing data list"width="990"/>
151
-
152
177
**Example:**
153
178
* You can see less data on one page.
154
179
* You will need a pagination to see more rows.
155
180
* Data structure includes many visual elements.
156
181
157
182
## Alternative solutions
183
+
158
184
Alternative to a data list include [tables](/components/table/design-guidelines) or [card views](/components/card/design-guidelines#card-views). Card views and data lists have similar properties, but information in a card view is chunked into a grid of individual cards. In choosing between a data list and a card view, consider the type of data that will be displayed and the format that best suits that data. If you cannot easily fit all of the data that needs to be displayed into a card, a data list might be a better solution.
0 commit comments