Debian Codegraph @

node/@patternfly/patternfly/docs/layouts/Gallery/examples/Gallery.md

raw
1 ---
2 id: Gallery
3 section: foundations-and-styles
4 subsection: layouts
5 cssPrefix: pf-v6-l-gallery
6 ---import './Gallery.css'
7
8 ## Examples
9
10 ### Basic
11
12 ```html
13 <div class="pf-v6-l-gallery">
14 <div class="pf-v6-l-gallery__item">content</div>
15
16 <div class="pf-v6-l-gallery__item">content</div>
17
18 <div class="pf-v6-l-gallery__item">content</div>
19
20 <div class="pf-v6-l-gallery__item">content</div>
21
22 <div class="pf-v6-l-gallery__item">content</div>
23 </div>
24
25 ```
26
27 ### With gutter
28
29 ```html
30 <div class="pf-v6-l-gallery pf-m-gutter">
31 <div class="pf-v6-l-gallery__item">content</div>
32
33 <div class="pf-v6-l-gallery__item">content</div>
34
35 <div class="pf-v6-l-gallery__item">content</div>
36
37 <div class="pf-v6-l-gallery__item">content</div>
38
39 <div class="pf-v6-l-gallery__item">content</div>
40 </div>
41
42 ```
43
44 ### Grid template minmax() width customization
45
46 Grid template columms min value can be applied to <code>.pf-v6-l-gallery</code>. Min-width is set inline as `--pf-v6-l-gallery--GridTemplateColumns--min{-on-[breakpoint]}: {width}`.
47
48 ### Min width modified gallery
49
50 ```html
51 <div
52 class="pf-v6-l-gallery pf-m-gutter"
53 style="--pf-v6-l-gallery--GridTemplateColumns--min: 150px;"
54 >
55 <div class="pf-v6-l-gallery__item">content</div>
56
57 <div class="pf-v6-l-gallery__item">content</div>
58
59 <div class="pf-v6-l-gallery__item">content</div>
60
61 <div class="pf-v6-l-gallery__item">content</div>
62
63 <div class="pf-v6-l-gallery__item">content</div>
64 </div>
65
66 ```
67
68 ### Max width modified gallery
69
70 ```html
71 <div
72 class="pf-v6-l-gallery pf-m-gutter"
73 style="--pf-v6-l-gallery--GridTemplateColumns--max: 300px;"
74 >
75 <div class="pf-v6-l-gallery__item">content</div>
76
77 <div class="pf-v6-l-gallery__item">content</div>
78
79 <div class="pf-v6-l-gallery__item">content</div>
80
81 <div class="pf-v6-l-gallery__item">content</div>
82
83 <div class="pf-v6-l-gallery__item">content</div>
84 </div>
85
86 ```
87
88 ### Min width modified gallery, responsive updates
89
90 ```html
91 <div
92 class="pf-v6-l-gallery pf-m-gutter"
93 style="--pf-v6-l-gallery--GridTemplateColumns--min-on-md: 100px; --pf-v6-l-gallery--GridTemplateColumns--min-on-lg: 150px; --pf-v6-l-gallery--GridTemplateColumns--min-on-xl: 200px; --pf-v6-l-gallery--GridTemplateColumns--min-on-2xl: 300px;"
94 >
95 <div class="pf-v6-l-gallery__item">content</div>
96
97 <div class="pf-v6-l-gallery__item">content</div>
98
99 <div class="pf-v6-l-gallery__item">content</div>
100
101 <div class="pf-v6-l-gallery__item">content</div>
102
103 <div class="pf-v6-l-gallery__item">content</div>
104 </div>
105
106 ```
107
108 ### Max width modified gallery, responsive updates
109
110 ```html
111 <div
112 class="pf-v6-l-gallery pf-m-gutter"
113 style="--pf-v6-l-gallery--GridTemplateColumns--max-on-md: 280px; --pf-v6-l-gallery--GridTemplateColumns--max-on-lg: 320px; --pf-v6-l-gallery--GridTemplateColumns--max-on-2xl: 400px;"
114 >
115 <div class="pf-v6-l-gallery__item">content</div>
116
117 <div class="pf-v6-l-gallery__item">content</div>
118
119 <div class="pf-v6-l-gallery__item">content</div>
120
121 <div class="pf-v6-l-gallery__item">content</div>
122
123 <div class="pf-v6-l-gallery__item">content</div>
124 </div>
125
126 ```
127
128 ### Min and max width modified gallery, responsive updates
129
130 ```html
131 <div
132 class="pf-v6-l-gallery pf-m-gutter"
133 style="--pf-v6-l-gallery--GridTemplateColumns--min: 100%; --pf-v6-l-gallery--GridTemplateColumns--min-on-md: 100px; --pf-v6-l-gallery--GridTemplateColumns--max-on-md: 200px; --pf-v6-l-gallery--GridTemplateColumns--min-on-xl: 300px; --pf-v6-l-gallery--GridTemplateColumns--max-on-xl: 1fr;"
134 >
135 <div class="pf-v6-l-gallery__item">content</div>
136
137 <div class="pf-v6-l-gallery__item">content</div>
138
139 <div class="pf-v6-l-gallery__item">content</div>
140
141 <div class="pf-v6-l-gallery__item">content</div>
142
143 <div class="pf-v6-l-gallery__item">content</div>
144 </div>
145
146 ```
147
148 ### List type
149
150 ```html
151 <ul class="pf-v6-l-gallery pf-m-gutter">
152 <li class="pf-v6-l-gallery__item">content</li>
153
154 <li class="pf-v6-l-gallery__item">content</li>
155
156 <li class="pf-v6-l-gallery__item">content</li>
157
158 <li class="pf-v6-l-gallery__item">content</li>
159
160 <li class="pf-v6-l-gallery__item">content</li>
161 </ul>
162
163 ```
164
165 ## Documentation
166
167 ### Overview
168
169 The gallery layout is designed so that all of its children are of uniform size, display horizontally, and wrap responsively.
170
171 ### Usage
172
173 | Class | Applied to | Outcome |
174 | -- | -- | -- |
175 | `.pf-v6-l-gallery` | `<div>` | Initializes a Gallery layout |
176 | `.pf-v6-l-gallery__item` | `<div>` | Explicitly sets the child for the gallery. This class isn't necessary, but it is included to keep inline with BEM convention, and to provide an entity that will later be used for applying modifiers. |
177 | `.pf-m-gutter` | `.pf-v6-l-gallery` | Adds space between children by using the globally defined gutter value. |
178 | `--pf-v6-l-gallery--GridTemplateColumns--min{-on-[breakpoint]}: {width}` | `.pf-v6-l-gallery` | Modifies the min value of `grid-template-columns` declaration at the optional [breakpoint](/foundations-and-styles/design-tokens/all-design-tokens). |
179 | `--pf-v6-l-gallery--GridTemplateColumns--max{-on-[breakpoint]}: {width}` | `.pf-v6-l-gallery` | Modifies the max value of `grid-template-columns` declaration at the optional [breakpoint](/foundations-and-styles/design-tokens/all-design-tokens). |