@czi-sds/mcp 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/tailwind.json +25 -25
- package/data/zeroheight-cache.json +5065 -1
- package/data/zeroheight-exports/Accordion.md +81 -20
- package/data/zeroheight-exports/Banner.md +104 -10
- package/data/zeroheight-exports/Buttons.md +1029 -1454
- package/data/zeroheight-exports/Callout.md +174 -9
- package/data/zeroheight-exports/Colors.md +1164 -41
- package/data/zeroheight-exports/Content-Card.md +148 -0
- package/data/zeroheight-exports/Control-Inputs.md +778 -63
- package/data/zeroheight-exports/Corners.md +8 -15
- package/data/zeroheight-exports/Dialog.md +200 -12
- package/data/zeroheight-exports/Downloads.md +120 -0
- package/data/zeroheight-exports/Dropdown-Input.md +616 -12
- package/data/zeroheight-exports/Dropdown-Menus.md +1150 -0
- package/data/zeroheight-exports/Field-Inputs.md +450 -9
- package/data/zeroheight-exports/Filters.md +238 -9
- package/data/zeroheight-exports/Getting-Started.md +7 -3
- package/data/zeroheight-exports/Hero.md +152 -0
- package/data/zeroheight-exports/Icons.md +1854 -218
- package/data/zeroheight-exports/Intent.md +40 -0
- package/data/zeroheight-exports/Link.md +52 -6
- package/data/zeroheight-exports/Lists.md +364 -6
- package/data/zeroheight-exports/Loading-Indicator.md +8 -0
- package/data/zeroheight-exports/Navigation.md +328 -6
- package/data/zeroheight-exports/Notification.md +172 -12
- package/data/zeroheight-exports/Panel.md +72 -12
- package/data/zeroheight-exports/README.md +17 -19
- package/data/zeroheight-exports/Responsive-Design.md +52 -0
- package/data/zeroheight-exports/Search-Input.md +44 -0
- package/data/zeroheight-exports/Search.md +248 -0
- package/data/zeroheight-exports/Segmented-Control.md +34 -9
- package/data/zeroheight-exports/Table.md +468 -47
- package/data/zeroheight-exports/Tabs.md +542 -9
- package/data/zeroheight-exports/Tags.md +504 -12
- package/data/zeroheight-exports/Text-Link.md +100 -0
- package/data/zeroheight-exports/Theming.md +36 -6
- package/data/zeroheight-exports/Tooltips.md +466 -15
- package/data/zeroheight-exports/Typography.md +64 -32
- package/package.json +3 -3
- package/data/zeroheight-exports/Dropdown-Menu.md +0 -3883
|
@@ -13,6 +13,18 @@ Buttons are one of the primary ways users interact with and provide input to the
|
|
|
13
13
|
|
|
14
14
|
Use the links below to jump to information on a specific Button variant:
|
|
15
15
|
|
|
16
|
+
**Button**
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
**Button**
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
**ButtonIcon**
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
16
28
|
---
|
|
17
29
|
|
|
18
30
|
## Square Button
|
|
@@ -29,6 +41,22 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
29
41
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
30
42
|
| ----------- | --------- | ----------- | ------------ |
|
|
31
43
|
|
|
44
|
+
**Button**
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
**Button**
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
**Button**
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
**Button**
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
32
60
|
### Small Primary Square Button
|
|
33
61
|
|
|
34
62
|
Use for actions that are lower importance or don't require as much emphasis on the page such as actions taken in the page footer.
|
|
@@ -38,6 +66,22 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
38
66
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
39
67
|
| ----------- | --------- | ----------- | ------------ |
|
|
40
68
|
|
|
69
|
+
**Button**
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
**Button**
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
**Button**
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
**Button**
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
41
85
|
### Secondary Square Button
|
|
42
86
|
|
|
43
87
|
Use for a secondary action, or deemphasized Button. Often paired with primary Button.
|
|
@@ -49,12 +93,32 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
49
93
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
50
94
|
| ----------- | --------- | ----------- | ------------ |
|
|
51
95
|
|
|
96
|
+
**Button**
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
**Button**
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
**Button**
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
**Button**
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
52
112
|
---
|
|
53
113
|
|
|
54
114
|
### Square Button Spacing
|
|
55
115
|
|
|
56
116
|
These rules establish how much margin should exist between and around elements.
|
|
57
117
|
|
|
118
|
+
**Square Button spacing**
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
58
122
|
---
|
|
59
123
|
|
|
60
124
|
## Copy Button
|
|
@@ -69,6 +133,22 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
69
133
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
70
134
|
| ----------- | --------- | ----------- | ------------ |
|
|
71
135
|
|
|
136
|
+
**Button**
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
**Button**
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
**Button**
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
**Button**
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
72
152
|
---
|
|
73
153
|
|
|
74
154
|
### Copy Button Spacing
|
|
@@ -77,6 +157,10 @@ These rules establish how much margin should exist between and around elements.
|
|
|
77
157
|
|
|
78
158
|
|
|
79
159
|
|
|
160
|
+
**Copy Button spacing**
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
80
164
|
---
|
|
81
165
|
|
|
82
166
|
## Icon Button
|
|
@@ -95,6 +179,18 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
95
179
|
| **Default** | **Hover** | **Pressed** |
|
|
96
180
|
| ----------- | --------- | ----------- |
|
|
97
181
|
|
|
182
|
+
**ButtonIcon**
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
**ButtonIcon**
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
**ButtonIcon**
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
98
194
|
### Medium Icon Button
|
|
99
195
|
|
|
100
196
|
The Icon Button should be used for lowest level actions that are not a part of the user's main workflow, such as closing a Dialog or expanding an Accordion (documentation coming soon).
|
|
@@ -106,6 +202,18 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
106
202
|
| **Default** | **Hover** | **Pressed** |
|
|
107
203
|
| ----------- | --------- | ----------- |
|
|
108
204
|
|
|
205
|
+
**ButtonIcon**
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
**ButtonIcon**
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
**ButtonIcon**
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
109
217
|
### Small Icon Button
|
|
110
218
|
|
|
111
219
|
The Icon Button should be used for lowest level actions that are not a part of the user's main workflow, such as closing a Dialog or expanding an Accordion (documentation coming soon).
|
|
@@ -117,6 +225,18 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
117
225
|
| **Default** | **Hover** | **Pressed** |
|
|
118
226
|
| ----------- | --------- | ----------- |
|
|
119
227
|
|
|
228
|
+
**ButtonIcon**
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
**ButtonIcon**
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
**ButtonIcon**
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
120
240
|
---
|
|
121
241
|
|
|
122
242
|
### Icon Button Spacing
|
|
@@ -125,6 +245,10 @@ These rules establish how much margin should exist between and around elements.
|
|
|
125
245
|
|
|
126
246
|
|
|
127
247
|
|
|
248
|
+
**Icon Button spacing**
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
128
252
|
## Code
|
|
129
253
|
|
|
130
254
|
## Button Components
|
|
@@ -161,6 +285,30 @@ Buttons are one of the primary ways users interact with and provide input to the
|
|
|
161
285
|
|
|
162
286
|
Use the links below to jump to information on a specific Button variant:
|
|
163
287
|
|
|
288
|
+
**Button**
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
**Button**
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
**Button**
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
**ButtonIcon**
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
**ButtonDropdown**
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
**ButtonDropdown**
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
164
312
|
---
|
|
165
313
|
|
|
166
314
|
## Rounded Button
|
|
@@ -179,9 +327,41 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
179
327
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
180
328
|
| ----------- | --------- | ----------- | ------------ |
|
|
181
329
|
|
|
330
|
+
**Button**
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
**Button**
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
**Button**
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
**Button**
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
182
346
|
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
183
347
|
| ------------------ | --------- | ----------- | ------------ |
|
|
184
348
|
|
|
349
|
+
**Button**
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
**Button**
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
**Button**
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
**Button**
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
185
365
|
|
|
186
366
|
|
|
187
367
|
|
|
@@ -197,41 +377,46 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
197
377
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
198
378
|
| ----------- | --------- | ----------- | ------------ |
|
|
199
379
|
|
|
200
|
-
|
|
201
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
380
|
+
**Button**
|
|
202
381
|
|
|
382
|
+
---
|
|
203
383
|
|
|
384
|
+
**Button**
|
|
204
385
|
|
|
205
|
-
|
|
386
|
+
---
|
|
206
387
|
|
|
207
|
-
|
|
388
|
+
**Button**
|
|
208
389
|
|
|
209
|
-
|
|
390
|
+
---
|
|
210
391
|
|
|
211
|
-
|
|
392
|
+
**Button**
|
|
212
393
|
|
|
213
|
-
|
|
214
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
394
|
+
---
|
|
215
395
|
|
|
216
396
|
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
217
397
|
| ------------------ | --------- | ----------- | ------------ |
|
|
218
398
|
|
|
399
|
+
**Button**
|
|
400
|
+
|
|
219
401
|
---
|
|
220
402
|
|
|
221
|
-
|
|
403
|
+
**Button**
|
|
222
404
|
|
|
223
|
-
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
**Button**
|
|
224
408
|
|
|
225
409
|
---
|
|
226
410
|
|
|
227
|
-
|
|
411
|
+
**Button**
|
|
228
412
|
|
|
229
|
-
|
|
230
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
|
|
413
|
+
---
|
|
231
414
|
|
|
232
|
-
### Primary Square Button
|
|
233
415
|
|
|
234
|
-
|
|
416
|
+
|
|
417
|
+
### Error Rounded Button
|
|
418
|
+
|
|
419
|
+
Use the error Button when the outcome of the user clicking the button will result in something being removed or deleted.
|
|
235
420
|
|
|
236
421
|
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
237
422
|
|
|
@@ -240,55 +425,61 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
240
425
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
241
426
|
| ----------- | --------- | ----------- | ------------ |
|
|
242
427
|
|
|
243
|
-
|
|
244
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
428
|
+
**Button**
|
|
245
429
|
|
|
246
|
-
|
|
430
|
+
---
|
|
247
431
|
|
|
248
|
-
|
|
432
|
+
**Button**
|
|
249
433
|
|
|
250
|
-
|
|
434
|
+
---
|
|
251
435
|
|
|
252
|
-
|
|
436
|
+
**Button**
|
|
253
437
|
|
|
254
|
-
|
|
255
|
-
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
**Button**
|
|
441
|
+
|
|
442
|
+
---
|
|
256
443
|
|
|
257
444
|
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
258
445
|
| ------------------ | --------- | ----------- | ------------ |
|
|
259
446
|
|
|
260
|
-
|
|
447
|
+
**Button**
|
|
261
448
|
|
|
262
|
-
|
|
449
|
+
---
|
|
263
450
|
|
|
264
|
-
|
|
451
|
+
**Button**
|
|
265
452
|
|
|
266
|
-
|
|
453
|
+
---
|
|
267
454
|
|
|
268
|
-
|
|
269
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
455
|
+
**Button**
|
|
270
456
|
|
|
271
|
-
|
|
272
|
-
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
**Button**
|
|
273
460
|
|
|
274
461
|
---
|
|
275
462
|
|
|
276
|
-
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
### Rounded Button Spacing
|
|
277
466
|
|
|
278
467
|
These rules establish how much margin should exist between and around elements.
|
|
279
468
|
|
|
469
|
+
**Rounded Button Spacing**
|
|
470
|
+
|
|
280
471
|
---
|
|
281
472
|
|
|
282
|
-
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
## Square Button
|
|
283
476
|
|
|
284
477
|
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
285
478
|
| --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
|
|
286
479
|
|
|
287
|
-
### Primary
|
|
288
|
-
|
|
289
|
-
Text Buttons initiate actions that keep the user on the same page, such as opening or closing dialog windows or overlays. They should contain a maximum of 2-3 words.
|
|
480
|
+
### Primary Square Button
|
|
290
481
|
|
|
291
|
-
|
|
482
|
+
Used to complete primary actions within Forms and Dropdown Menus; paired with Text Inputs.
|
|
292
483
|
|
|
293
484
|
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
294
485
|
|
|
@@ -297,88 +488,400 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
297
488
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
298
489
|
| ----------- | --------- | ----------- | ------------ |
|
|
299
490
|
|
|
300
|
-
|
|
301
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
### Secondary Minimal Button
|
|
491
|
+
**Button**
|
|
306
492
|
|
|
307
|
-
|
|
493
|
+
---
|
|
308
494
|
|
|
309
|
-
|
|
495
|
+
**Button**
|
|
310
496
|
|
|
311
|
-
|
|
497
|
+
---
|
|
312
498
|
|
|
313
|
-
|
|
314
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
499
|
+
**Button**
|
|
315
500
|
|
|
316
501
|
---
|
|
317
502
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
These rules establish how much margin should exist between and around elements.
|
|
503
|
+
**Button**
|
|
321
504
|
|
|
322
505
|
---
|
|
323
506
|
|
|
324
|
-
|
|
507
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
508
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
325
509
|
|
|
326
|
-
|
|
327
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
|
|
510
|
+
**Button**
|
|
328
511
|
|
|
329
|
-
|
|
512
|
+
---
|
|
330
513
|
|
|
331
|
-
|
|
514
|
+
**Button**
|
|
332
515
|
|
|
333
|
-
|
|
516
|
+
---
|
|
334
517
|
|
|
335
|
-
|
|
518
|
+
**Button**
|
|
336
519
|
|
|
337
|
-
|
|
520
|
+
---
|
|
338
521
|
|
|
339
|
-
|
|
340
|
-
| ----------------- | --------------- | ----------- | ---------------- | -------------- | ------------ |
|
|
522
|
+
**Button**
|
|
341
523
|
|
|
342
|
-
|
|
524
|
+
---
|
|
343
525
|
|
|
344
|
-
|
|
526
|
+
### Secondary Square Button
|
|
345
527
|
|
|
346
|
-
|
|
528
|
+
Used to complete secondary actions within Forms and Dropdown Menus; paired with Text Inputs.
|
|
347
529
|
|
|
348
|
-
|
|
530
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
349
531
|
|
|
350
532
|
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
351
533
|
|
|
352
534
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
353
535
|
| ----------- | --------- | ----------- | ------------ |
|
|
354
536
|
|
|
355
|
-
|
|
537
|
+
**Button**
|
|
356
538
|
|
|
357
|
-
|
|
539
|
+
---
|
|
358
540
|
|
|
359
|
-
|
|
541
|
+
**Button**
|
|
360
542
|
|
|
361
|
-
|
|
543
|
+
---
|
|
362
544
|
|
|
363
|
-
|
|
545
|
+
**Button**
|
|
364
546
|
|
|
365
|
-
|
|
366
|
-
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
547
|
+
---
|
|
367
548
|
|
|
368
|
-
|
|
549
|
+
**Button**
|
|
369
550
|
|
|
370
|
-
|
|
551
|
+
---
|
|
371
552
|
|
|
372
|
-
|
|
553
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
554
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
555
|
+
|
|
556
|
+
**Button**
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
|
|
560
|
+
**Button**
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
**Button**
|
|
565
|
+
|
|
566
|
+
---
|
|
567
|
+
|
|
568
|
+
**Button**
|
|
569
|
+
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
### Error Square Button
|
|
573
|
+
|
|
574
|
+
Use the error Button when the outcome of the user clicking the button will result in something being removed or deleted.
|
|
575
|
+
|
|
576
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
577
|
+
|
|
578
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
579
|
+
|
|
580
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
581
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
582
|
+
|
|
583
|
+
**Button**
|
|
584
|
+
|
|
585
|
+
---
|
|
586
|
+
|
|
587
|
+
**Button**
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
**Button**
|
|
592
|
+
|
|
593
|
+
---
|
|
594
|
+
|
|
595
|
+
**Button**
|
|
596
|
+
|
|
597
|
+
---
|
|
598
|
+
|
|
599
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
600
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
601
|
+
|
|
602
|
+
**Button**
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
**Button**
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
**Button**
|
|
611
|
+
|
|
612
|
+
---
|
|
613
|
+
|
|
614
|
+
**Button**
|
|
615
|
+
|
|
616
|
+
---
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
### Square Button Spacing
|
|
621
|
+
|
|
622
|
+
These rules establish how much margin should exist between and around elements.
|
|
623
|
+
|
|
624
|
+
**Square Button Spacing**
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
---
|
|
629
|
+
|
|
630
|
+
## Minimal Button
|
|
631
|
+
|
|
632
|
+
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
633
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
|
|
634
|
+
|
|
635
|
+
### Primary Minimal Button
|
|
636
|
+
|
|
637
|
+
Text Buttons initiate actions that keep the user on the same page, such as opening or closing dialog windows or overlays. They should contain a maximum of 2-3 words.
|
|
638
|
+
|
|
639
|
+
If a longer or inline call to action with a similar visual style is needed, a Text Link might be more appropriate. In addition to containing more words, Text Links navigate the user away from their current page to a new one, whereas Minimal Buttons keep users on the same page.
|
|
640
|
+
|
|
641
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
642
|
+
|
|
643
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
644
|
+
|
|
645
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
646
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
647
|
+
|
|
648
|
+
**Button**
|
|
649
|
+
|
|
650
|
+
---
|
|
651
|
+
|
|
652
|
+
**Button**
|
|
653
|
+
|
|
654
|
+
---
|
|
655
|
+
|
|
656
|
+
**Button**
|
|
657
|
+
|
|
658
|
+
---
|
|
659
|
+
|
|
660
|
+
**Button**
|
|
661
|
+
|
|
662
|
+
---
|
|
663
|
+
|
|
664
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
665
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
666
|
+
|
|
667
|
+
**Button**
|
|
668
|
+
|
|
669
|
+
---
|
|
670
|
+
|
|
671
|
+
**Button**
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
675
|
+
**Button**
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
679
|
+
**Button**
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
### Secondary Minimal Button
|
|
686
|
+
|
|
687
|
+
Use for a deemphasized action or when paired with a Primary Minimal Button.
|
|
688
|
+
|
|
689
|
+
Note: only Primary Minimal Buttons can be paired with icons.
|
|
690
|
+
|
|
691
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
692
|
+
|
|
693
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
694
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
695
|
+
|
|
696
|
+
**Button**
|
|
697
|
+
|
|
698
|
+
---
|
|
699
|
+
|
|
700
|
+
**Button**
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
**Button**
|
|
705
|
+
|
|
706
|
+
---
|
|
707
|
+
|
|
708
|
+
**Button**
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
---
|
|
713
|
+
|
|
714
|
+
### Minimal Button Spacing
|
|
715
|
+
|
|
716
|
+
These rules establish how much margin should exist between and around elements.
|
|
717
|
+
|
|
718
|
+
**Text Button Spacing**
|
|
719
|
+
|
|
720
|
+
---
|
|
721
|
+
|
|
722
|
+
---
|
|
723
|
+
|
|
724
|
+
## Icon Button
|
|
725
|
+
|
|
726
|
+
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
727
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
|
|
728
|
+
|
|
729
|
+
### Large Primary Icon Button
|
|
730
|
+
|
|
731
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
732
|
+
|
|
733
|
+
The Primary Icon Button should be used in places that require the user's primary attention or to emphasize a primary action.
|
|
373
734
|
|
|
374
735
|
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
375
736
|
|
|
376
737
|
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
377
738
|
|
|
378
|
-
| **Default (Off)** | **Hover (Off)** | **Default (On)** | **Hover (On)** | **Disabled** |
|
|
379
|
-
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
739
|
+
| **Default (Off)** | **Hover (Off)** | **Pressed** | **Default (On)** | **Hover (On)** | **Disabled** |
|
|
740
|
+
| ----------------- | --------------- | ----------- | ---------------- | -------------- | ------------ |
|
|
741
|
+
|
|
742
|
+
**ButtonIcon**
|
|
743
|
+
|
|
744
|
+
---
|
|
745
|
+
|
|
746
|
+
**ButtonIcon**
|
|
747
|
+
|
|
748
|
+
---
|
|
749
|
+
|
|
750
|
+
**ButtonIcon**
|
|
751
|
+
|
|
752
|
+
---
|
|
753
|
+
|
|
754
|
+
**ButtonIcon**
|
|
755
|
+
|
|
756
|
+
---
|
|
757
|
+
|
|
758
|
+
**ButtonIcon**
|
|
759
|
+
|
|
760
|
+
---
|
|
761
|
+
|
|
762
|
+
**ButtonIcon**
|
|
763
|
+
|
|
764
|
+
---
|
|
765
|
+
|
|
766
|
+
### Small Primary Icon Button
|
|
767
|
+
|
|
768
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
769
|
+
|
|
770
|
+
The Primary Icon Button should be used in places that require the user's primary attention or to emphasize a primary action.
|
|
771
|
+
|
|
772
|
+
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
773
|
+
|
|
774
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
775
|
+
|
|
776
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
777
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
778
|
+
|
|
779
|
+
**ButtonIcon**
|
|
780
|
+
|
|
781
|
+
---
|
|
782
|
+
|
|
783
|
+
**ButtonIcon**
|
|
784
|
+
|
|
785
|
+
---
|
|
786
|
+
|
|
787
|
+
**ButtonIcon**
|
|
788
|
+
|
|
789
|
+
---
|
|
790
|
+
|
|
791
|
+
**ButtonIcon**
|
|
792
|
+
|
|
793
|
+
---
|
|
794
|
+
|
|
795
|
+
### Large Secondary Icon Button
|
|
796
|
+
|
|
797
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
798
|
+
|
|
799
|
+
The Secondary Icon Button should be used for deemphasized or secondary actions; often paired with the Primary Icon Button.
|
|
800
|
+
|
|
801
|
+
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
802
|
+
|
|
803
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
804
|
+
|
|
805
|
+
| **Default (Off)** | **Hover (Off)** | **Default (On)** | **Hover (On)** | **Disabled** |
|
|
806
|
+
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
807
|
+
|
|
808
|
+
**ButtonIcon**
|
|
809
|
+
|
|
810
|
+
---
|
|
811
|
+
|
|
812
|
+
**ButtonIcon**
|
|
813
|
+
|
|
814
|
+
---
|
|
815
|
+
|
|
816
|
+
**ButtonIcon**
|
|
817
|
+
|
|
818
|
+
---
|
|
819
|
+
|
|
820
|
+
**ButtonIcon**
|
|
821
|
+
|
|
822
|
+
---
|
|
823
|
+
|
|
824
|
+
**ButtonIcon**
|
|
825
|
+
|
|
826
|
+
---
|
|
827
|
+
|
|
828
|
+
### Small Secondary Icon Button
|
|
829
|
+
|
|
830
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
831
|
+
|
|
832
|
+
The Secondary Icon Button should be used for deemphasized or secondary actions; often paired with the Primary Icon Button.
|
|
833
|
+
|
|
834
|
+
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
835
|
+
|
|
836
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
837
|
+
|
|
838
|
+
| **Default (Off)** | **Hover (Off)** | **Default (On)** | **Hover (On)** | **Disabled** |
|
|
839
|
+
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
840
|
+
|
|
841
|
+
**ButtonIcon**
|
|
842
|
+
|
|
843
|
+
---
|
|
844
|
+
|
|
845
|
+
**ButtonIcon**
|
|
846
|
+
|
|
847
|
+
---
|
|
848
|
+
|
|
849
|
+
**ButtonIcon**
|
|
850
|
+
|
|
851
|
+
---
|
|
852
|
+
|
|
853
|
+
**ButtonIcon**
|
|
854
|
+
|
|
855
|
+
---
|
|
856
|
+
|
|
857
|
+
**ButtonIcon**
|
|
858
|
+
|
|
859
|
+
---
|
|
860
|
+
|
|
861
|
+
### Large Tertiary Icon Button
|
|
862
|
+
|
|
863
|
+
The Tertiary Icon Button should be used for lowest level actions that are not a part of the user's main workflow, such as closing a Dialog or expanding an Accordion (documentation coming soon). It is not usually paired with other Icon Buttons.
|
|
864
|
+
|
|
865
|
+
Use the Tertiary Icon Button size that is most appropriate for the design it is being used in.
|
|
866
|
+
|
|
867
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
868
|
+
|
|
869
|
+
| **Default** | **Hover** | **Pressed** |
|
|
870
|
+
| ----------- | --------- | ----------- |
|
|
871
|
+
|
|
872
|
+
**ButtonIcon**
|
|
873
|
+
|
|
874
|
+
---
|
|
875
|
+
|
|
876
|
+
**ButtonIcon**
|
|
877
|
+
|
|
878
|
+
---
|
|
879
|
+
|
|
880
|
+
**ButtonIcon**
|
|
881
|
+
|
|
882
|
+
---
|
|
380
883
|
|
|
381
|
-
###
|
|
884
|
+
### Medium Tertiary Icon Button
|
|
382
885
|
|
|
383
886
|
The Tertiary Icon Button should be used for lowest level actions that are not a part of the user's main workflow, such as closing a Dialog or expanding an Accordion (documentation coming soon). It is not usually paired with other Icon Buttons.
|
|
384
887
|
|
|
@@ -389,16 +892,17 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
389
892
|
| **Default** | **Hover** | **Pressed** |
|
|
390
893
|
| ----------- | --------- | ----------- |
|
|
391
894
|
|
|
392
|
-
|
|
895
|
+
**ButtonIcon**
|
|
393
896
|
|
|
394
|
-
|
|
897
|
+
---
|
|
395
898
|
|
|
396
|
-
|
|
899
|
+
**ButtonIcon**
|
|
397
900
|
|
|
398
|
-
|
|
901
|
+
---
|
|
399
902
|
|
|
400
|
-
|
|
401
|
-
|
|
903
|
+
**ButtonIcon**
|
|
904
|
+
|
|
905
|
+
---
|
|
402
906
|
|
|
403
907
|
### Small Tertiary Icon Button
|
|
404
908
|
|
|
@@ -411,12 +915,28 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
411
915
|
| **Default** | **Hover** | **Pressed** |
|
|
412
916
|
| ----------- | --------- | ----------- |
|
|
413
917
|
|
|
918
|
+
**ButtonIcon**
|
|
919
|
+
|
|
920
|
+
---
|
|
921
|
+
|
|
922
|
+
**ButtonIcon**
|
|
923
|
+
|
|
924
|
+
---
|
|
925
|
+
|
|
926
|
+
**ButtonIcon**
|
|
927
|
+
|
|
928
|
+
---
|
|
929
|
+
|
|
414
930
|
---
|
|
415
931
|
|
|
416
932
|
### Icon Button Spacing
|
|
417
933
|
|
|
418
934
|
These rules establish how much margin should exist between and around elements.
|
|
419
935
|
|
|
936
|
+
**Icon Button Spacing**
|
|
937
|
+
|
|
938
|
+
---
|
|
939
|
+
|
|
420
940
|
---
|
|
421
941
|
|
|
422
942
|
## Rounded Dropdown Button
|
|
@@ -437,6 +957,22 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
437
957
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
438
958
|
| ----------- | --------- | ----------- | ------------ |
|
|
439
959
|
|
|
960
|
+
**ButtonDropdown**
|
|
961
|
+
|
|
962
|
+
---
|
|
963
|
+
|
|
964
|
+
**ButtonDropdown**
|
|
965
|
+
|
|
966
|
+
---
|
|
967
|
+
|
|
968
|
+
**ButtonDropdown**
|
|
969
|
+
|
|
970
|
+
---
|
|
971
|
+
|
|
972
|
+
**ButtonDropdown**
|
|
973
|
+
|
|
974
|
+
---
|
|
975
|
+
|
|
440
976
|
|
|
441
977
|
|
|
442
978
|
### Secondary Rounded Dropdown Button
|
|
@@ -450,12 +986,32 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
450
986
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
451
987
|
| ----------- | --------- | ----------- | ------------ |
|
|
452
988
|
|
|
989
|
+
**ButtonDropdown**
|
|
990
|
+
|
|
991
|
+
---
|
|
992
|
+
|
|
993
|
+
**ButtonDropdown**
|
|
994
|
+
|
|
995
|
+
---
|
|
996
|
+
|
|
997
|
+
**ButtonDropdown**
|
|
998
|
+
|
|
999
|
+
---
|
|
1000
|
+
|
|
1001
|
+
**ButtonDropdown**
|
|
1002
|
+
|
|
1003
|
+
---
|
|
1004
|
+
|
|
453
1005
|
---
|
|
454
1006
|
|
|
455
1007
|
### Rounded Dropdown Button Spacing
|
|
456
1008
|
|
|
457
1009
|
These rules establish how much margin should exist between and around elements.
|
|
458
1010
|
|
|
1011
|
+
**Rounded Dropdown Button Spacing**
|
|
1012
|
+
|
|
1013
|
+
---
|
|
1014
|
+
|
|
459
1015
|
---
|
|
460
1016
|
|
|
461
1017
|
|
|
@@ -478,6 +1034,22 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
478
1034
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
479
1035
|
| ----------- | --------- | ----------- | ------------ |
|
|
480
1036
|
|
|
1037
|
+
**ButtonDropdown**
|
|
1038
|
+
|
|
1039
|
+
---
|
|
1040
|
+
|
|
1041
|
+
**ButtonDropdown**
|
|
1042
|
+
|
|
1043
|
+
---
|
|
1044
|
+
|
|
1045
|
+
**ButtonDropdown**
|
|
1046
|
+
|
|
1047
|
+
---
|
|
1048
|
+
|
|
1049
|
+
**ButtonDropdown**
|
|
1050
|
+
|
|
1051
|
+
---
|
|
1052
|
+
|
|
481
1053
|
### Secondary Square Dropdown Button
|
|
482
1054
|
|
|
483
1055
|
Use when there is a need to present the user with multiple options for actions that can be performed using a Button (generally in a similar context as icon Buttons).
|
|
@@ -491,12 +1063,32 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
491
1063
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
492
1064
|
| ----------- | --------- | ----------- | ------------ |
|
|
493
1065
|
|
|
1066
|
+
**ButtonDropdown**
|
|
1067
|
+
|
|
1068
|
+
---
|
|
1069
|
+
|
|
1070
|
+
**ButtonDropdown**
|
|
1071
|
+
|
|
1072
|
+
---
|
|
1073
|
+
|
|
1074
|
+
**ButtonDropdown**
|
|
1075
|
+
|
|
1076
|
+
---
|
|
1077
|
+
|
|
1078
|
+
**ButtonDropdown**
|
|
1079
|
+
|
|
1080
|
+
---
|
|
1081
|
+
|
|
494
1082
|
---
|
|
495
1083
|
|
|
496
1084
|
### Square Dropdown Button Spacing
|
|
497
1085
|
|
|
498
1086
|
These rules establish how much margin should exist between and around elements.
|
|
499
1087
|
|
|
1088
|
+
**Square Dropdown Button Spacing**
|
|
1089
|
+
|
|
1090
|
+
---
|
|
1091
|
+
|
|
500
1092
|
## Code
|
|
501
1093
|
|
|
502
1094
|
## Button Components
|
|
@@ -539,73 +1131,36 @@ Buttons are one of the primary ways users interact with and provide input to the
|
|
|
539
1131
|
|
|
540
1132
|
Use the links below to jump to information on a specific Button variant:
|
|
541
1133
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
## Rounded Button
|
|
545
|
-
|
|
546
|
-
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
547
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
548
|
-
|
|
549
|
-
### Primary Rounded Button
|
|
550
|
-
|
|
551
|
-
General use for a primary or emphasized action.
|
|
552
|
-
|
|
553
|
-
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
554
|
-
|
|
555
|
-
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
556
|
-
|
|
557
|
-
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
558
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
559
|
-
|
|
560
|
-
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
561
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
### Secondary Rounded Button
|
|
566
|
-
|
|
567
|
-
Use for a secondary action, or deemphasized Button. Often paired with primary Button.
|
|
568
|
-
|
|
569
|
-
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
570
|
-
|
|
571
|
-
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
572
|
-
|
|
573
|
-
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
574
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
575
|
-
|
|
576
|
-
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
577
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
1134
|
+
**Button**
|
|
578
1135
|
|
|
579
|
-
|
|
1136
|
+
---
|
|
580
1137
|
|
|
581
|
-
|
|
1138
|
+
**Button**
|
|
582
1139
|
|
|
583
|
-
|
|
1140
|
+
---
|
|
584
1141
|
|
|
585
|
-
|
|
1142
|
+
**Button**
|
|
586
1143
|
|
|
587
|
-
|
|
588
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
1144
|
+
---
|
|
589
1145
|
|
|
590
|
-
|
|
591
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
1146
|
+
**ButtonIcon**
|
|
592
1147
|
|
|
593
1148
|
---
|
|
594
1149
|
|
|
595
|
-
|
|
1150
|
+
**ButtonDropdown**
|
|
596
1151
|
|
|
597
|
-
|
|
1152
|
+
---
|
|
598
1153
|
|
|
599
1154
|
---
|
|
600
1155
|
|
|
601
|
-
##
|
|
1156
|
+
## Rounded Button
|
|
602
1157
|
|
|
603
1158
|
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
604
1159
|
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
605
1160
|
|
|
606
|
-
### Primary
|
|
1161
|
+
### Primary Rounded Button
|
|
607
1162
|
|
|
608
|
-
|
|
1163
|
+
General use for a primary or emphasized action.
|
|
609
1164
|
|
|
610
1165
|
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
611
1166
|
|
|
@@ -614,55 +1169,46 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
614
1169
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
615
1170
|
| ----------- | --------- | ----------- | ------------ |
|
|
616
1171
|
|
|
617
|
-
|
|
618
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
1172
|
+
**Button**
|
|
619
1173
|
|
|
620
|
-
|
|
1174
|
+
---
|
|
621
1175
|
|
|
622
|
-
|
|
1176
|
+
**Button**
|
|
623
1177
|
|
|
624
|
-
|
|
1178
|
+
---
|
|
625
1179
|
|
|
626
|
-
|
|
1180
|
+
**Button**
|
|
627
1181
|
|
|
628
|
-
|
|
629
|
-
|
|
1182
|
+
---
|
|
1183
|
+
|
|
1184
|
+
**Button**
|
|
1185
|
+
|
|
1186
|
+
---
|
|
630
1187
|
|
|
631
1188
|
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
632
1189
|
| ------------------ | --------- | ----------- | ------------ |
|
|
633
1190
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
Use the error Button when the outcome of the user clicking the button will result in something being removed or deleted.
|
|
1191
|
+
**Button**
|
|
637
1192
|
|
|
638
|
-
|
|
1193
|
+
---
|
|
639
1194
|
|
|
640
|
-
|
|
1195
|
+
**Button**
|
|
641
1196
|
|
|
642
|
-
|
|
643
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
1197
|
+
---
|
|
644
1198
|
|
|
645
|
-
|
|
646
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
1199
|
+
**Button**
|
|
647
1200
|
|
|
648
1201
|
---
|
|
649
1202
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
These rules establish how much margin should exist between and around elements.
|
|
1203
|
+
**Button**
|
|
653
1204
|
|
|
654
1205
|
---
|
|
655
1206
|
|
|
656
|
-
## Minimal Button
|
|
657
|
-
|
|
658
|
-
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
659
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
660
1207
|
|
|
661
|
-
### Primary Minimal Button
|
|
662
1208
|
|
|
663
|
-
|
|
1209
|
+
### Secondary Rounded Button
|
|
664
1210
|
|
|
665
|
-
|
|
1211
|
+
Use for a secondary action, or deemphasized Button. Often paired with primary Button.
|
|
666
1212
|
|
|
667
1213
|
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
668
1214
|
|
|
@@ -671,1635 +1217,664 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
671
1217
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
672
1218
|
| ----------- | --------- | ----------- | ------------ |
|
|
673
1219
|
|
|
674
|
-
|
|
675
|
-
| ------------------ | --------- | ----------- | ------------ |
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
### Secondary Minimal Button
|
|
680
|
-
|
|
681
|
-
Use for a deemphasized action or when paired with a Primary Minimal Button
|
|
682
|
-
|
|
683
|
-
Note: only Primary Minimal Buttons can be paired with icons.
|
|
684
|
-
|
|
685
|
-
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
686
|
-
|
|
687
|
-
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
688
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
1220
|
+
**Button**
|
|
689
1221
|
|
|
1222
|
+
---
|
|
690
1223
|
|
|
1224
|
+
**Button**
|
|
691
1225
|
|
|
692
1226
|
---
|
|
693
1227
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
These rules establish how much margin should exist between and around elements.
|
|
1228
|
+
**Button**
|
|
697
1229
|
|
|
698
1230
|
---
|
|
699
1231
|
|
|
700
|
-
|
|
1232
|
+
**Button**
|
|
701
1233
|
|
|
702
|
-
|
|
703
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
1234
|
+
---
|
|
704
1235
|
|
|
705
|
-
|
|
1236
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
1237
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
706
1238
|
|
|
707
|
-
|
|
1239
|
+
**Button**
|
|
708
1240
|
|
|
709
|
-
|
|
1241
|
+
---
|
|
710
1242
|
|
|
711
|
-
|
|
1243
|
+
**Button**
|
|
712
1244
|
|
|
713
|
-
|
|
1245
|
+
---
|
|
714
1246
|
|
|
715
|
-
|
|
716
|
-
| ----------------- | --------------- | ----------- | ---------------- | -------------- | ------------ |
|
|
1247
|
+
**Button**
|
|
717
1248
|
|
|
1249
|
+
---
|
|
718
1250
|
|
|
1251
|
+
**Button**
|
|
719
1252
|
|
|
720
|
-
|
|
1253
|
+
---
|
|
721
1254
|
|
|
722
|
-
|
|
1255
|
+
### Error Rounded Button
|
|
723
1256
|
|
|
724
|
-
|
|
1257
|
+
Use the error Button when the outcome of the user clicking the button will result in something being removed or deleted.
|
|
725
1258
|
|
|
726
|
-
|
|
1259
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
727
1260
|
|
|
728
1261
|
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
729
1262
|
|
|
730
1263
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
731
1264
|
| ----------- | --------- | ----------- | ------------ |
|
|
732
1265
|
|
|
733
|
-
|
|
1266
|
+
**Button**
|
|
734
1267
|
|
|
735
|
-
|
|
1268
|
+
---
|
|
736
1269
|
|
|
737
|
-
|
|
1270
|
+
**Button**
|
|
738
1271
|
|
|
739
|
-
|
|
1272
|
+
---
|
|
740
1273
|
|
|
741
|
-
|
|
1274
|
+
**Button**
|
|
742
1275
|
|
|
743
|
-
|
|
744
|
-
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
1276
|
+
---
|
|
745
1277
|
|
|
746
|
-
|
|
1278
|
+
**Button**
|
|
747
1279
|
|
|
748
|
-
|
|
1280
|
+
---
|
|
749
1281
|
|
|
750
|
-
|
|
1282
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
1283
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
751
1284
|
|
|
752
|
-
|
|
1285
|
+
**Button**
|
|
753
1286
|
|
|
754
|
-
|
|
1287
|
+
---
|
|
755
1288
|
|
|
756
|
-
|
|
757
|
-
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
1289
|
+
**Button**
|
|
758
1290
|
|
|
759
|
-
|
|
1291
|
+
---
|
|
760
1292
|
|
|
761
|
-
|
|
1293
|
+
**Button**
|
|
762
1294
|
|
|
763
|
-
|
|
1295
|
+
---
|
|
764
1296
|
|
|
765
|
-
|
|
1297
|
+
**Button**
|
|
766
1298
|
|
|
767
|
-
|
|
768
|
-
| ----------- | --------- | ----------- |
|
|
1299
|
+
---
|
|
769
1300
|
|
|
770
|
-
|
|
1301
|
+
---
|
|
771
1302
|
|
|
772
|
-
|
|
1303
|
+
### Rounded Button Spacing
|
|
1304
|
+
|
|
1305
|
+
These rules establish how much margin should exist between and around elements.
|
|
1306
|
+
|
|
1307
|
+
**Rounded Button Spacing**
|
|
1308
|
+
|
|
1309
|
+
---
|
|
773
1310
|
|
|
774
|
-
|
|
1311
|
+
---
|
|
775
1312
|
|
|
776
|
-
|
|
1313
|
+
## Square Button
|
|
777
1314
|
|
|
778
|
-
|
|
|
779
|
-
|
|
|
1315
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
1316
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
780
1317
|
|
|
781
|
-
###
|
|
1318
|
+
### Primary Square Button
|
|
782
1319
|
|
|
783
|
-
|
|
1320
|
+
Used to complete primary actions within Forms and Dropdown Menus; paired with Text Inputs.
|
|
784
1321
|
|
|
785
|
-
|
|
1322
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
786
1323
|
|
|
787
1324
|
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
788
1325
|
|
|
789
|
-
| **Default** | **Hover** | **Pressed** |
|
|
790
|
-
| ----------- | --------- | ----------- |
|
|
1326
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
1327
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
1328
|
+
|
|
1329
|
+
**Button**
|
|
791
1330
|
|
|
792
1331
|
---
|
|
793
1332
|
|
|
794
|
-
|
|
1333
|
+
**Button**
|
|
795
1334
|
|
|
796
|
-
|
|
1335
|
+
---
|
|
1336
|
+
|
|
1337
|
+
**Button**
|
|
797
1338
|
|
|
798
1339
|
---
|
|
799
1340
|
|
|
800
|
-
|
|
1341
|
+
**Button**
|
|
801
1342
|
|
|
802
|
-
|
|
803
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
1343
|
+
---
|
|
804
1344
|
|
|
805
|
-
|
|
1345
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
1346
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
806
1347
|
|
|
807
|
-
|
|
1348
|
+
**Button**
|
|
808
1349
|
|
|
809
|
-
|
|
1350
|
+
---
|
|
810
1351
|
|
|
811
|
-
|
|
1352
|
+
**Button**
|
|
812
1353
|
|
|
813
|
-
|
|
1354
|
+
---
|
|
814
1355
|
|
|
815
|
-
|
|
816
|
-
| ----------- | --------- | ----------- | ------------ |
|
|
1356
|
+
**Button**
|
|
817
1357
|
|
|
1358
|
+
---
|
|
818
1359
|
|
|
1360
|
+
**Button**
|
|
819
1361
|
|
|
820
|
-
|
|
1362
|
+
---
|
|
821
1363
|
|
|
822
|
-
|
|
1364
|
+
### Secondary Square Button
|
|
823
1365
|
|
|
824
|
-
|
|
1366
|
+
Used to complete secondary actions within Forms and Dropdown Menus; paired with Text Inputs.
|
|
1367
|
+
|
|
1368
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
825
1369
|
|
|
826
1370
|
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
827
1371
|
|
|
828
1372
|
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
829
1373
|
| ----------- | --------- | ----------- | ------------ |
|
|
830
1374
|
|
|
1375
|
+
**Button**
|
|
1376
|
+
|
|
831
1377
|
---
|
|
832
1378
|
|
|
833
|
-
|
|
1379
|
+
**Button**
|
|
834
1380
|
|
|
835
|
-
|
|
1381
|
+
---
|
|
836
1382
|
|
|
837
|
-
|
|
1383
|
+
**Button**
|
|
838
1384
|
|
|
839
|
-
|
|
1385
|
+
---
|
|
840
1386
|
|
|
841
|
-
|
|
842
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------- |
|
|
1387
|
+
**Button**
|
|
843
1388
|
|
|
844
1389
|
---
|
|
845
1390
|
|
|
846
|
-
|
|
1391
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
1392
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
847
1393
|
|
|
848
|
-
|
|
1394
|
+
**Button**
|
|
849
1395
|
|
|
850
1396
|
---
|
|
851
1397
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
Storybook
|
|
1398
|
+
**Button**
|
|
855
1399
|
|
|
856
1400
|
---
|
|
857
1401
|
|
|
858
|
-
|
|
1402
|
+
**Button**
|
|
859
1403
|
|
|
860
|
-
|
|
1404
|
+
---
|
|
1405
|
+
|
|
1406
|
+
**Button**
|
|
861
1407
|
|
|
862
1408
|
---
|
|
863
1409
|
|
|
864
|
-
|
|
1410
|
+
### Error Square Button
|
|
865
1411
|
|
|
866
|
-
|
|
1412
|
+
Use the error Button when the outcome of the user clicking the button will result in something being removed or deleted.
|
|
867
1413
|
|
|
868
|
-
|
|
1414
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
869
1415
|
|
|
870
|
-
|
|
871
|
-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------- |
|
|
1416
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
872
1417
|
|
|
873
|
-
|
|
1418
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
1419
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
1420
|
+
|
|
1421
|
+
**Button**
|
|
874
1422
|
|
|
875
1423
|
---
|
|
876
1424
|
|
|
877
|
-
|
|
1425
|
+
**Button**
|
|
1426
|
+
|
|
1427
|
+
---
|
|
878
1428
|
|
|
879
|
-
|
|
880
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
|
|
1429
|
+
**Button**
|
|
881
1430
|
|
|
882
|
-
|
|
1431
|
+
---
|
|
883
1432
|
|
|
884
|
-
|
|
1433
|
+
**Button**
|
|
885
1434
|
|
|
886
1435
|
---
|
|
887
1436
|
|
|
888
|
-
|
|
1437
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
1438
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
889
1439
|
|
|
890
|
-
|
|
1440
|
+
**Button**
|
|
1441
|
+
|
|
1442
|
+
---
|
|
891
1443
|
|
|
892
|
-
|
|
1444
|
+
**Button**
|
|
893
1445
|
|
|
894
1446
|
---
|
|
895
1447
|
|
|
896
|
-
|
|
1448
|
+
**Button**
|
|
897
1449
|
|
|
898
|
-
|
|
1450
|
+
---
|
|
899
1451
|
|
|
900
|
-
|
|
1452
|
+
**Button**
|
|
901
1453
|
|
|
902
|
-
|
|
1454
|
+
---
|
|
903
1455
|
|
|
904
|
-
|
|
1456
|
+
---
|
|
905
1457
|
|
|
906
|
-
|
|
1458
|
+
### Square Button Spacing
|
|
907
1459
|
|
|
908
|
-
|
|
909
|
-
| ------- | ----- | ------- | -------- |
|
|
1460
|
+
These rules establish how much margin should exist between and around elements.
|
|
910
1461
|
|
|
911
|
-
|
|
1462
|
+
**Square Button Spacing**
|
|
912
1463
|
|
|
913
|
-
|
|
914
|
-
| ------- | ----- | ------- | -------- |
|
|
1464
|
+
---
|
|
915
1465
|
|
|
916
|
-
|
|
1466
|
+
---
|
|
917
1467
|
|
|
918
|
-
|
|
1468
|
+
## Minimal Button
|
|
919
1469
|
|
|
920
|
-
|
|
1470
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
1471
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
921
1472
|
|
|
922
|
-
|
|
1473
|
+
### Primary Minimal Button
|
|
923
1474
|
|
|
924
|
-
|
|
925
|
-
| ------- | ----- | ------- | -------- |
|
|
1475
|
+
Text Buttons initiate actions that keep the user on the same page, such as opening or closing dialog windows or overlays. They should contain a maximum of 2-3 words.
|
|
926
1476
|
|
|
927
|
-
|
|
1477
|
+
If a longer or inline call to action with a similar visual style is needed, a Text Link might be more appropriate. In addition to containing more words, Text Links navigate the user away from their current page to a new one, whereas Minimal Buttons keep users on the same page.
|
|
928
1478
|
|
|
929
|
-
|
|
930
|
-
| ------- | ----- | ------- | -------- |
|
|
1479
|
+
Include an icon when needing to provide additional context to users of what action the Button has.
|
|
931
1480
|
|
|
932
|
-
|
|
1481
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
933
1482
|
|
|
934
|
-
|
|
1483
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
1484
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
935
1485
|
|
|
936
|
-
|
|
1486
|
+
**Button**
|
|
937
1487
|
|
|
938
|
-
|
|
1488
|
+
---
|
|
939
1489
|
|
|
940
|
-
|
|
941
|
-
| ------- | ----- | ------- | -------- |
|
|
1490
|
+
**Button**
|
|
942
1491
|
|
|
943
|
-
|
|
1492
|
+
---
|
|
944
1493
|
|
|
945
|
-
|
|
946
|
-
| ------- | ----- | ------- | -------- |
|
|
1494
|
+
**Button**
|
|
947
1495
|
|
|
948
1496
|
---
|
|
949
1497
|
|
|
950
|
-
|
|
1498
|
+
**Button**
|
|
951
1499
|
|
|
952
|
-
|
|
1500
|
+
---
|
|
953
1501
|
|
|
954
|
-
|
|
1502
|
+
| **Default + Icon** | **Hover** | **Pressed** | **Disabled** |
|
|
1503
|
+
| ------------------ | --------- | ----------- | ------------ |
|
|
955
1504
|
|
|
956
|
-
|
|
1505
|
+
**Button**
|
|
957
1506
|
|
|
958
|
-
|
|
1507
|
+
---
|
|
959
1508
|
|
|
960
|
-
|
|
1509
|
+
**Button**
|
|
961
1510
|
|
|
962
|
-
|
|
963
|
-
| ------- | ----- | ------- | -------- |
|
|
1511
|
+
---
|
|
964
1512
|
|
|
965
|
-
|
|
1513
|
+
**Button**
|
|
966
1514
|
|
|
967
|
-
|
|
968
|
-
| ------- | ----- | ------- | -------- |
|
|
1515
|
+
---
|
|
969
1516
|
|
|
970
|
-
|
|
1517
|
+
**Button**
|
|
971
1518
|
|
|
972
|
-
|
|
1519
|
+
---
|
|
973
1520
|
|
|
974
|
-
Include an icon when needing to provide additional context to users of what action the Button has. Label text is available in all caps or title case; title case used by default.
|
|
975
1521
|
|
|
976
|
-
_Title Case_
|
|
977
1522
|
|
|
978
|
-
|
|
979
|
-
| ------- | ----- | ------- | -------- |
|
|
1523
|
+
### Secondary Minimal Button
|
|
980
1524
|
|
|
981
|
-
|
|
1525
|
+
Use for a deemphasized action or when paired with a Primary Minimal Button
|
|
982
1526
|
|
|
983
|
-
|
|
984
|
-
| ------- | ----- | ------- | -------- |
|
|
1527
|
+
Note: only Primary Minimal Buttons can be paired with icons.
|
|
985
1528
|
|
|
986
|
-
|
|
1529
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
987
1530
|
|
|
988
|
-
|
|
1531
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
1532
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
989
1533
|
|
|
990
|
-
|
|
1534
|
+
**Button**
|
|
991
1535
|
|
|
992
|
-
|
|
1536
|
+
---
|
|
993
1537
|
|
|
994
|
-
|
|
995
|
-
| ------- | ----- | ------- | -------- |
|
|
1538
|
+
**Button**
|
|
996
1539
|
|
|
997
|
-
|
|
1540
|
+
---
|
|
998
1541
|
|
|
999
|
-
|
|
1000
|
-
| ------- | ----- | ------- | -------- |
|
|
1542
|
+
**Button**
|
|
1001
1543
|
|
|
1002
1544
|
---
|
|
1003
1545
|
|
|
1004
|
-
|
|
1546
|
+
**Button**
|
|
1005
1547
|
|
|
1006
|
-
|
|
1548
|
+
---
|
|
1007
1549
|
|
|
1008
|
-
If a longer or inline call to action with a similar visual style is needed, a Link might be more appropriate. In addition to containing more words, Text Links navigate the user away from their current page to a new one, whereas Minimal Buttons keep users on the same page.
|
|
1009
1550
|
|
|
1010
|
-
#### Primary
|
|
1011
1551
|
|
|
1012
|
-
|
|
1552
|
+
---
|
|
1013
1553
|
|
|
1014
|
-
|
|
1554
|
+
### Minimal Button Spacing
|
|
1015
1555
|
|
|
1016
|
-
|
|
1556
|
+
These rules establish how much margin should exist between and around elements.
|
|
1017
1557
|
|
|
1018
|
-
|
|
1019
|
-
| ------- | ----- | ------- | -------- |
|
|
1558
|
+
**Minimal Button Spacing**
|
|
1020
1559
|
|
|
1021
|
-
|
|
1560
|
+
---
|
|
1022
1561
|
|
|
1023
|
-
|
|
1024
|
-
| ------- | ----- | ------- | -------- |
|
|
1562
|
+
---
|
|
1025
1563
|
|
|
1026
|
-
|
|
1564
|
+
## Icon Button
|
|
1027
1565
|
|
|
1028
|
-
|
|
1566
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
1567
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
1029
1568
|
|
|
1030
|
-
|
|
1569
|
+
### Large Primary Icon Button
|
|
1031
1570
|
|
|
1032
|
-
|
|
1571
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
1033
1572
|
|
|
1034
|
-
|
|
1035
|
-
| ------- | ----- | ------- | -------- |
|
|
1573
|
+
The Primary Icon Button should be used in places that require the user's primary attention or to emphasize a primary action.
|
|
1036
1574
|
|
|
1037
|
-
|
|
1575
|
+
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
1038
1576
|
|
|
1039
|
-
|
|
1040
|
-
| ------- | ----- | ------- | -------- |
|
|
1577
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1041
1578
|
|
|
1042
|
-
|
|
1579
|
+
| **Default (Off)** | **Hover (Off)** | **Pressed** | **Default (On)** | **Hover (On)** | **Disabled** |
|
|
1580
|
+
| ----------------- | --------------- | ----------- | ---------------- | -------------- | ------------ |
|
|
1043
1581
|
|
|
1044
|
-
|
|
1582
|
+
**ButtonIcon**
|
|
1045
1583
|
|
|
1046
|
-
|
|
1584
|
+
---
|
|
1047
1585
|
|
|
1048
|
-
|
|
1586
|
+
**ButtonIcon**
|
|
1049
1587
|
|
|
1050
|
-
|
|
1588
|
+
---
|
|
1051
1589
|
|
|
1052
|
-
|
|
1590
|
+
**ButtonIcon**
|
|
1053
1591
|
|
|
1054
|
-
|
|
1592
|
+
---
|
|
1055
1593
|
|
|
1056
|
-
|
|
1057
|
-
| ------- | ----- | ------- | -------- |
|
|
1594
|
+
**ButtonIcon**
|
|
1058
1595
|
|
|
1059
|
-
|
|
1596
|
+
---
|
|
1060
1597
|
|
|
1061
|
-
|
|
1062
|
-
| ------- | ----- | ------- | -------- |
|
|
1598
|
+
**ButtonIcon**
|
|
1063
1599
|
|
|
1064
|
-
|
|
1600
|
+
---
|
|
1065
1601
|
|
|
1066
|
-
|
|
1067
|
-
| ------- | ----- | ------- | -------- |
|
|
1602
|
+
**ButtonIcon**
|
|
1068
1603
|
|
|
1069
|
-
|
|
1604
|
+
---
|
|
1070
1605
|
|
|
1071
|
-
Secondary Button – Icon should be used for deemphasized or secondary actions. Can be paired with other Button components.
|
|
1072
1606
|
|
|
1073
|
-
_Large_
|
|
1074
1607
|
|
|
1075
|
-
|
|
1076
|
-
| ------- | ----- | ------- | -------- |
|
|
1608
|
+
### Small Primary Icon Button
|
|
1077
1609
|
|
|
1078
|
-
|
|
1610
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
1079
1611
|
|
|
1080
|
-
|
|
1081
|
-
| ------- | ----- | ------- | -------- |
|
|
1612
|
+
The Primary Icon Button should be used in places that require the user's primary attention or to emphasize a primary action.
|
|
1082
1613
|
|
|
1083
|
-
|
|
1614
|
+
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
1084
1615
|
|
|
1085
|
-
|
|
1086
|
-
| ------- | ----- | ------- | -------- |
|
|
1616
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1087
1617
|
|
|
1088
|
-
|
|
1618
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
1619
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
1089
1620
|
|
|
1090
|
-
|
|
1621
|
+
**ButtonIcon**
|
|
1091
1622
|
|
|
1092
|
-
|
|
1623
|
+
---
|
|
1093
1624
|
|
|
1094
|
-
|
|
1095
|
-
| ------- | ----- | ------- | -------- |
|
|
1625
|
+
**ButtonIcon**
|
|
1096
1626
|
|
|
1097
|
-
|
|
1627
|
+
---
|
|
1098
1628
|
|
|
1099
|
-
|
|
1100
|
-
| ------- | ----- | ------- | -------- |
|
|
1629
|
+
**ButtonIcon**
|
|
1101
1630
|
|
|
1102
|
-
|
|
1631
|
+
---
|
|
1103
1632
|
|
|
1104
|
-
|
|
1105
|
-
| ------- | ----- | ------- | -------- |
|
|
1633
|
+
**ButtonIcon**
|
|
1106
1634
|
|
|
1107
1635
|
---
|
|
1108
1636
|
|
|
1109
|
-
### Button
|
|
1637
|
+
### Large Secondary Icon Button
|
|
1110
1638
|
|
|
1111
|
-
|
|
1639
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
1112
1640
|
|
|
1113
|
-
|
|
1641
|
+
The Secondary Icon Button should be used for deemphasized or secondary actions; often paired with the Primary Icon Button.
|
|
1114
1642
|
|
|
1115
|
-
|
|
1643
|
+
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
1116
1644
|
|
|
1117
|
-
|
|
1118
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
|
|
1645
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1119
1646
|
|
|
1120
|
-
|
|
1647
|
+
| **Default (Off)** | **Hover (Off)** | **Default (On)** | **Hover (On)** | **Disabled** |
|
|
1648
|
+
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
1121
1649
|
|
|
1122
|
-
|
|
1650
|
+
**ButtonIcon**
|
|
1123
1651
|
|
|
1124
1652
|
---
|
|
1125
1653
|
|
|
1126
|
-
|
|
1654
|
+
**ButtonIcon**
|
|
1127
1655
|
|
|
1128
|
-
|
|
1656
|
+
---
|
|
1129
1657
|
|
|
1130
|
-
|
|
1658
|
+
**ButtonIcon**
|
|
1131
1659
|
|
|
1132
1660
|
---
|
|
1133
1661
|
|
|
1134
|
-
|
|
1662
|
+
**ButtonIcon**
|
|
1135
1663
|
|
|
1136
|
-
|
|
1664
|
+
---
|
|
1137
1665
|
|
|
1138
|
-
|
|
1666
|
+
**ButtonIcon**
|
|
1139
1667
|
|
|
1140
|
-
|
|
1668
|
+
---
|
|
1141
1669
|
|
|
1142
|
-
|
|
1143
|
-
| ------- | ----- | ------- | -------- |
|
|
1670
|
+
### Small Secondary Icon Button
|
|
1144
1671
|
|
|
1145
|
-
|
|
1672
|
+
Use in instances where a standard sized Button won't fit or doesn't seem necessary such as in charts, tables, navigation bars, etc.
|
|
1146
1673
|
|
|
1147
|
-
The Secondary
|
|
1674
|
+
The Secondary Icon Button should be used for deemphasized or secondary actions; often paired with the Primary Icon Button.
|
|
1148
1675
|
|
|
1149
|
-
|
|
1150
|
-
| ------- | ----- | ------- | -------- |
|
|
1676
|
+
Icon Buttons can be coupled with a Dropdown Menu when there are multiple options available to the user upon triggering the Button.
|
|
1151
1677
|
|
|
1152
|
-
|
|
1678
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1153
1679
|
|
|
1154
|
-
|
|
1680
|
+
| **Default (Off)** | **Hover (Off)** | **Default (On)** | **Hover (On)** | **Disabled** |
|
|
1681
|
+
| ----------------- | --------------- | ---------------- | -------------- | ------------ |
|
|
1155
1682
|
|
|
1156
|
-
|
|
1683
|
+
**ButtonIcon**
|
|
1157
1684
|
|
|
1158
|
-
|
|
1685
|
+
---
|
|
1159
1686
|
|
|
1160
|
-
|
|
1687
|
+
**ButtonIcon**
|
|
1161
1688
|
|
|
1162
|
-
|
|
1163
|
-
| ------- | ----- | ------- | -------- |
|
|
1689
|
+
---
|
|
1164
1690
|
|
|
1165
|
-
|
|
1691
|
+
**ButtonIcon**
|
|
1166
1692
|
|
|
1167
|
-
|
|
1693
|
+
---
|
|
1168
1694
|
|
|
1169
|
-
|
|
1170
|
-
| ------- | ----- | ------- | -------- |
|
|
1695
|
+
**ButtonIcon**
|
|
1171
1696
|
|
|
1172
1697
|
---
|
|
1173
1698
|
|
|
1174
|
-
|
|
1699
|
+
**ButtonIcon**
|
|
1175
1700
|
|
|
1176
|
-
|
|
1701
|
+
---
|
|
1177
1702
|
|
|
1178
|
-
|
|
1703
|
+
### Large Tertiary Icon Button
|
|
1179
1704
|
|
|
1180
|
-
|
|
1705
|
+
The Tertiary Icon Button should be used for lowest level actions that are not a part of the user's main workflow, such as closing a Dialog or expanding an Accordion (documentation coming soon). It is not usually paired with other Icon Buttons.
|
|
1181
1706
|
|
|
1182
|
-
|
|
1707
|
+
Use the Tertiary Icon Button size that is most appropriate for the design it is being used in.
|
|
1183
1708
|
|
|
1184
|
-
|
|
1709
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1185
1710
|
|
|
1186
|
-
| Default | Hover | Pressed |
|
|
1187
|
-
|
|
|
1711
|
+
| **Default** | **Hover** | **Pressed** |
|
|
1712
|
+
| ----------- | --------- | ----------- |
|
|
1188
1713
|
|
|
1189
|
-
|
|
1714
|
+
**ButtonIcon**
|
|
1190
1715
|
|
|
1191
|
-
|
|
1192
|
-
| ------- | ----- | ------- | -------- |
|
|
1716
|
+
---
|
|
1193
1717
|
|
|
1194
|
-
|
|
1718
|
+
**ButtonIcon**
|
|
1195
1719
|
|
|
1196
|
-
|
|
1197
|
-
| ------- | ----- | ------- | -------- |
|
|
1720
|
+
---
|
|
1198
1721
|
|
|
1199
|
-
|
|
1722
|
+
**ButtonIcon**
|
|
1200
1723
|
|
|
1201
|
-
|
|
1724
|
+
---
|
|
1202
1725
|
|
|
1203
|
-
|
|
1726
|
+
### Medium Tertiary Icon Button
|
|
1204
1727
|
|
|
1205
|
-
|
|
1206
|
-
| ------- | ----- | ------- | -------- |
|
|
1728
|
+
The Tertiary Icon Button should be used for lowest level actions that are not a part of the user's main workflow, such as closing a Dialog or expanding an Accordion (documentation coming soon). It is not usually paired with other Icon Buttons.
|
|
1207
1729
|
|
|
1208
|
-
|
|
1730
|
+
Use the Tertiary Icon Button size that is most appropriate for the design it is being used in.
|
|
1209
1731
|
|
|
1210
|
-
|
|
1211
|
-
| ------- | ----- | ------- | -------- |
|
|
1732
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1212
1733
|
|
|
1213
|
-
|
|
1734
|
+
| **Default** | **Hover** | **Pressed** |
|
|
1735
|
+
| ----------- | --------- | ----------- |
|
|
1214
1736
|
|
|
1215
|
-
|
|
1216
|
-
| ------- | ----- | ------- | -------- |
|
|
1737
|
+
**ButtonIcon**
|
|
1217
1738
|
|
|
1218
1739
|
---
|
|
1219
1740
|
|
|
1220
|
-
|
|
1741
|
+
**ButtonIcon**
|
|
1221
1742
|
|
|
1222
|
-
|
|
1743
|
+
---
|
|
1744
|
+
|
|
1745
|
+
**ButtonIcon**
|
|
1223
1746
|
|
|
1224
1747
|
---
|
|
1225
1748
|
|
|
1226
|
-
|
|
1749
|
+
### Small Tertiary Icon Button
|
|
1750
|
+
|
|
1751
|
+
The Tertiary Icon Button should be used for lowest level actions that are not a part of the user's main workflow, such as closing a Dialog or expanding an Accordion (documentation coming soon). It is not usually paired with other Icon Buttons.
|
|
1227
1752
|
|
|
1228
|
-
|
|
1229
|
-
| --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
|
|
1753
|
+
Use the Tertiary Icon Button size that is most appropriate for the design it is being used in.
|
|
1230
1754
|
|
|
1231
|
-
|
|
1755
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1232
1756
|
|
|
1233
|
-
|
|
1757
|
+
| **Default** | **Hover** | **Pressed** |
|
|
1758
|
+
| ----------- | --------- | ----------- |
|
|
1234
1759
|
|
|
1235
|
-
|
|
1760
|
+
**ButtonIcon**
|
|
1236
1761
|
|
|
1237
1762
|
---
|
|
1238
1763
|
|
|
1239
|
-
|
|
1764
|
+
**ButtonIcon**
|
|
1240
1765
|
|
|
1241
|
-
|
|
1766
|
+
---
|
|
1242
1767
|
|
|
1243
|
-
|
|
1768
|
+
**ButtonIcon**
|
|
1244
1769
|
|
|
1245
|
-
|
|
1770
|
+
---
|
|
1246
1771
|
|
|
1247
|
-
|
|
1772
|
+
---
|
|
1248
1773
|
|
|
1249
|
-
|
|
1774
|
+
### Icon Button Spacing
|
|
1250
1775
|
|
|
1251
|
-
|
|
1252
|
-
| :-----------: | :---------: | :----------: | :----------: | :--------: | :-----------: | :------: |
|
|
1776
|
+
These rules establish how much margin should exist between and around elements.
|
|
1253
1777
|
|
|
1254
|
-
|
|
1778
|
+
**Icon Button_Large Spacing**
|
|
1255
1779
|
|
|
1256
|
-
|
|
1257
|
-
| :-----------: | :---------: | :----------: | :----------: | :--------: | :-----------: | :------: |
|
|
1780
|
+
---
|
|
1258
1781
|
|
|
1259
|
-
|
|
1782
|
+
---
|
|
1260
1783
|
|
|
1261
|
-
|
|
1262
|
-
| :-----------: | :---------: | :----------: | :----------: | :--------: | :-----------: | :------: |
|
|
1784
|
+
## Rounded Dropdown Button
|
|
1263
1785
|
|
|
1264
|
-
|
|
1786
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
1787
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
1265
1788
|
|
|
1266
|
-
|
|
1789
|
+
### Primary Rounded Dropdown Button
|
|
1267
1790
|
|
|
1268
|
-
|
|
1791
|
+
Use when there is a need to present the user with multiple options for actions that can be performed using a Button (generally in a similar context as Icon Buttons).
|
|
1269
1792
|
|
|
1270
|
-
|
|
1271
|
-
| :-----------: | :---------: | :----------: | :----------: | :--------: | :-----------: | :------: |
|
|
1793
|
+
The Primary Rounded Dropdown Button should be used in places that require the user's primary attention or to emphasize a primary action.
|
|
1272
1794
|
|
|
1273
|
-
|
|
1795
|
+
The options are presented in a dropdown menu; use in conjunction with Dropdown Menu component.
|
|
1274
1796
|
|
|
1275
|
-
|
|
1276
|
-
| :-----------: | :---------: | :----------: | :----------: | :--------: | :-----------: | :------: |
|
|
1797
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1277
1798
|
|
|
1278
|
-
|
|
1799
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
1800
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
1279
1801
|
|
|
1280
|
-
|
|
1281
|
-
| :-----------: | :---------: | :----------: | :----------: | :--------: | :-----------: | :------: |
|
|
1802
|
+
**ButtonDropdown**
|
|
1282
1803
|
|
|
1283
1804
|
---
|
|
1284
1805
|
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
These rules establish how much margin should exist between and around elements.
|
|
1288
|
-
|
|
1289
|
-
## Code
|
|
1806
|
+
**ButtonDropdown**
|
|
1290
1807
|
|
|
1291
|
-
|
|
1808
|
+
---
|
|
1292
1809
|
|
|
1293
|
-
|
|
1294
|
-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------- |
|
|
1810
|
+
**ButtonDropdown**
|
|
1295
1811
|
|
|
1296
|
-
|
|
1812
|
+
---
|
|
1297
1813
|
|
|
1298
|
-
|
|
1814
|
+
**ButtonDropdown**
|
|
1299
1815
|
|
|
1300
1816
|
---
|
|
1301
1817
|
|
|
1302
|
-
## Button
|
|
1303
|
-
|
|
1304
|
-
### SDS Source Code
|
|
1305
1818
|
|
|
1306
|
-
The component's source code in the SDS codebase can be found here.
|
|
1307
1819
|
|
|
1308
|
-
###
|
|
1820
|
+
### Secondary Rounded Dropdown Button
|
|
1309
1821
|
|
|
1310
|
-
|
|
1822
|
+
Use for Header-level Actions with multiple result options (generally in same context as Icon Buttons).
|
|
1311
1823
|
|
|
1312
|
-
|
|
1313
|
-
- **`color`\*\***:\*\* SDS'S`Button`does not support this colors or intents that would be expected through this prop. However, the `sdsType` prop can be used to set the button color as `primary` or `secondary`.
|
|
1314
|
-
- **`size`\*\***:\*\* This prop is not supported for SDS's `Button`
|
|
1315
|
-
- **`disableElevation`\*\***:\*\* The SDS `Button` component doesn't have a visual "elevation" or shadowed treatment by default (which this prop disables for MUI's `Button`). Setting `disableElevation={false}` will not render the MUI default elevation treatment.
|
|
1824
|
+
The options are presented in a dropdown menu; use in conjunction with Dropdown Menu component.
|
|
1316
1825
|
|
|
1317
|
-
|
|
1826
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
1318
1827
|
|
|
1319
|
-
|
|
1828
|
+
| **Default** | **Hover** | **Pressed** | **Disabled** |
|
|
1829
|
+
| ----------- | --------- | ----------- | ------------ |
|
|
1320
1830
|
|
|
1321
|
-
|
|
1831
|
+
**ButtonDropdown**
|
|
1322
1832
|
|
|
1323
|
-
|
|
1833
|
+
---
|
|
1324
1834
|
|
|
1325
|
-
|
|
1326
|
-
- **`sdsType`\*\***:\*\* takes `primary` (default, filled) or `secondary` (outlined) as values
|
|
1835
|
+
**ButtonDropdown**
|
|
1327
1836
|
|
|
1328
|
-
|
|
1837
|
+
---
|
|
1329
1838
|
|
|
1330
|
-
|
|
1839
|
+
**ButtonDropdown**
|
|
1331
1840
|
|
|
1332
|
-
|
|
1841
|
+
---
|
|
1333
1842
|
|
|
1334
|
-
|
|
1843
|
+
**ButtonDropdown**
|
|
1335
1844
|
|
|
1336
|
-
|
|
1845
|
+
---
|
|
1337
1846
|
|
|
1338
|
-
|
|
1339
|
-
| ----------- | ------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------- |
|
|
1340
|
-
| `isAllCaps` | `bool` | `false` | When set to `true`, the button text will be displayed in all capital letters. Please note that the `isAllCaps` attribute only applies to buttons with the `sdsStyle` set to `minimal`. |
|
|
1341
|
-
| `sdsStyle` | `"rounded" | "square"` | `-` | Style of the button. |
|
|
1342
|
-
| `sdsType` | `"primary"` ` | "secondary"` ` | "destructive"` | `-` | Type of the button. |
|
|
1847
|
+
---
|
|
1343
1848
|
|
|
1344
|
-
|
|
1849
|
+
### Rounded Dropdown Button Spacing
|
|
1345
1850
|
|
|
1346
|
-
|
|
1347
|
-
| ----------- | ------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
|
|
1348
|
-
| `isAllCaps` | `bool` | `false` | When set to `true`, the button text will be displayed in all capital letters. Please note that the `isAllCaps` attribute only applies to buttons with the `sdsStyle` set to `minimal`. |
|
|
1349
|
-
| `sdsStyle` | `"minimal"` | `-` | Style of the button. |
|
|
1350
|
-
| `sdsType` | `"primary"` ` | "secondary"` | `-` | Type of the button. |
|
|
1851
|
+
These rules establish how much margin should exist between and around elements.
|
|
1351
1852
|
|
|
1352
|
-
|
|
1853
|
+
**Rounded Dropdown Button Spacing**
|
|
1353
1854
|
|
|
1354
|
-
|
|
1355
|
-
| -------------- | -------------------- | ----------------------------------- | ------------------------------------------ | --------------- | --------------------------------------- |
|
|
1356
|
-
| `sdsSize` | `"small"` ` | "medium"` ` | "large"` | `medium` | Determines the size of the button icon. |
|
|
1357
|
-
| `sdsStyle` | `"icon"` | `-` | Style of the button. |
|
|
1358
|
-
| `sdsType` | `"primary"` ` | "secondary"` ` | "tertiary"` | `-` | Type of the button icon. |
|
|
1359
|
-
| `icon` | `SDSIcon | React.ReactElement<CustomSVGProps>` | `-` | The actual icon |
|
|
1360
|
-
| `sdsIconProps` | `Partial<IconProps>` | `-` | Props for the icon if an sds icon is used. |
|
|
1855
|
+
---
|
|
1361
1856
|
|
|
1362
|
-
|
|
1857
|
+
## Code
|
|
1363
1858
|
|
|
1364
|
-
|
|
1859
|
+
## Button Components
|
|
1365
1860
|
|
|
1366
|
-
|
|
1861
|
+
| Below you will find interactive Storybook iframes for each component within the Button element group. Tabs within each iframe provide a different set of tools: The Controls tab allows you to see and adjust all available props. The Actions tab shows you data displayed by event handler arguments. | | **Jump to component:** Button ButtonIcon ButtonDropdown |
|
|
1862
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------- |
|
|
1367
1863
|
|
|
1368
|
-
|
|
1864
|
+
---
|
|
1369
1865
|
|
|
1370
|
-
|
|
1371
|
-
body {
|
|
1372
|
-
font-size: 13px;
|
|
1373
|
-
font-weight: 400;
|
|
1374
|
-
letter-spacing: 0.08px;
|
|
1375
|
-
line-height: 20px;
|
|
1376
|
-
text-transform: none;
|
|
1377
|
-
font-family: "Inter", sans-serif;
|
|
1378
|
-
}
|
|
1866
|
+
### Button
|
|
1379
1867
|
|
|
1380
|
-
|
|
1381
|
-
font-size: 1.5rem;
|
|
1382
|
-
}
|
|
1868
|
+
Storybook
|
|
1383
1869
|
|
|
1384
|
-
|
|
1385
|
-
padding: 20px;
|
|
1386
|
-
}
|
|
1387
|
-
```
|
|
1870
|
+
---
|
|
1388
1871
|
|
|
1389
|
-
|
|
1872
|
+
### ButtonIcon
|
|
1390
1873
|
|
|
1391
|
-
|
|
1392
|
-
{
|
|
1393
|
-
"include": ["./**/*"],
|
|
1394
|
-
"compilerOptions": {
|
|
1395
|
-
"strict": true,
|
|
1396
|
-
"esModuleInterop": true,
|
|
1397
|
-
"lib": ["dom", "es2015"],
|
|
1398
|
-
"jsx": "react-jsx"
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
```
|
|
1402
|
-
|
|
1403
|
-
**/App.tsx**
|
|
1404
|
-
|
|
1405
|
-
```tsx
|
|
1406
|
-
import { Button } from "@czi-sds/components";
|
|
1407
|
-
import "./styles.css";
|
|
1408
|
-
|
|
1409
|
-
function App() {
|
|
1410
|
-
return (
|
|
1411
|
-
<div className="app">
|
|
1412
|
-
<Button sdsType="primary" sdsStyle="square">
|
|
1413
|
-
Label
|
|
1414
|
-
</Button>
|
|
1415
|
-
</div>
|
|
1416
|
-
);
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
export default App;
|
|
1420
|
-
```
|
|
1421
|
-
|
|
1422
|
-
**/index.tsx**
|
|
1423
|
-
|
|
1424
|
-
```tsx
|
|
1425
|
-
import React from "react";
|
|
1426
|
-
import { createRoot } from "react-dom/client";
|
|
1427
|
-
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
1428
|
-
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
1429
|
-
import { Theme } from "@czi-sds/components";
|
|
1430
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
1431
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
1432
|
-
|
|
1433
|
-
import App from "./App";
|
|
1434
|
-
|
|
1435
|
-
const container = document.getElementById("root");
|
|
1436
|
-
const root = createRoot(container!);
|
|
1437
|
-
|
|
1438
|
-
const RootApp = () => {
|
|
1439
|
-
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
1440
|
-
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
1441
|
-
|
|
1442
|
-
return (
|
|
1443
|
-
<StyledEngineProvider injectFirst>
|
|
1444
|
-
<ThemeProvider theme={theme}>
|
|
1445
|
-
<EmotionThemeProvider theme={theme}>
|
|
1446
|
-
<CssBaseline />
|
|
1447
|
-
<App />
|
|
1448
|
-
</EmotionThemeProvider>
|
|
1449
|
-
</ThemeProvider>
|
|
1450
|
-
</StyledEngineProvider>
|
|
1451
|
-
);
|
|
1452
|
-
};
|
|
1453
|
-
|
|
1454
|
-
root.render(
|
|
1455
|
-
<React.StrictMode>
|
|
1456
|
-
<RootApp />
|
|
1457
|
-
</React.StrictMode>
|
|
1458
|
-
);
|
|
1459
|
-
```
|
|
1460
|
-
|
|
1461
|
-
**/public/index.html**
|
|
1462
|
-
|
|
1463
|
-
```html
|
|
1464
|
-
<!doctype html>
|
|
1465
|
-
<html lang="en">
|
|
1466
|
-
<head>
|
|
1467
|
-
<meta charset="UTF-8" />
|
|
1468
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
1469
|
-
<title>Button</title>
|
|
1470
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
1471
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
1472
|
-
<link
|
|
1473
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
1474
|
-
rel="stylesheet"
|
|
1475
|
-
/>
|
|
1476
|
-
<link
|
|
1477
|
-
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
1478
|
-
rel="stylesheet"
|
|
1479
|
-
/>
|
|
1480
|
-
</head>
|
|
1481
|
-
<body>
|
|
1482
|
-
<div id="root"></div>
|
|
1483
|
-
</body>
|
|
1484
|
-
</html>
|
|
1485
|
-
```
|
|
1486
|
-
|
|
1487
|
-
**/package.json**
|
|
1488
|
-
|
|
1489
|
-
```json
|
|
1490
|
-
{
|
|
1491
|
-
"dependencies": {
|
|
1492
|
-
"react": "^18.0.0",
|
|
1493
|
-
"react-dom": "^18.0.0",
|
|
1494
|
-
"react-scripts": "^4.0.0"
|
|
1495
|
-
},
|
|
1496
|
-
"devDependencies": {
|
|
1497
|
-
"@types/react": "^18.0.0",
|
|
1498
|
-
"@types/react-dom": "^18.0.0",
|
|
1499
|
-
"typescript": "^4.0.0"
|
|
1500
|
-
},
|
|
1501
|
-
"main": "/index.tsx"
|
|
1502
|
-
}
|
|
1503
|
-
```
|
|
1504
|
-
|
|
1505
|
-
---
|
|
1506
|
-
|
|
1507
|
-
#### Button + Icon
|
|
1508
|
-
|
|
1509
|
-
This example shows a `Secondary` button component with an icon.
|
|
1510
|
-
|
|
1511
|
-
**/styles.css**
|
|
1512
|
-
|
|
1513
|
-
```css
|
|
1514
|
-
body {
|
|
1515
|
-
font-size: 13px;
|
|
1516
|
-
font-weight: 400;
|
|
1517
|
-
letter-spacing: 0.08px;
|
|
1518
|
-
line-height: 20px;
|
|
1519
|
-
text-transform: none;
|
|
1520
|
-
font-family: "Inter", sans-serif;
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
h1 {
|
|
1524
|
-
font-size: 1.5rem;
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
.app {
|
|
1528
|
-
padding: 20px;
|
|
1529
|
-
}
|
|
1530
|
-
```
|
|
1531
|
-
|
|
1532
|
-
**tsconfig.json**
|
|
1533
|
-
|
|
1534
|
-
```json
|
|
1535
|
-
{
|
|
1536
|
-
"include": ["./**/*"],
|
|
1537
|
-
"compilerOptions": {
|
|
1538
|
-
"strict": true,
|
|
1539
|
-
"esModuleInterop": true,
|
|
1540
|
-
"lib": ["dom", "es2015"],
|
|
1541
|
-
"jsx": "react-jsx"
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
```
|
|
1545
|
-
|
|
1546
|
-
**/App.tsx**
|
|
1547
|
-
|
|
1548
|
-
```tsx
|
|
1549
|
-
import { Button, Icon } from "@czi-sds/components";
|
|
1550
|
-
import "./styles.css";
|
|
1551
|
-
|
|
1552
|
-
function App() {
|
|
1553
|
-
return (
|
|
1554
|
-
<div className="app">
|
|
1555
|
-
<Button
|
|
1556
|
-
sdsType="secondary"
|
|
1557
|
-
sdsStyle="square"
|
|
1558
|
-
startIcon={<Icon sdsIcon="Download" sdsSize="s" sdsType="button" />}
|
|
1559
|
-
>
|
|
1560
|
-
Download
|
|
1561
|
-
</Button>
|
|
1562
|
-
</div>
|
|
1563
|
-
);
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
export default App;
|
|
1567
|
-
```
|
|
1568
|
-
|
|
1569
|
-
**/index.tsx**
|
|
1570
|
-
|
|
1571
|
-
```tsx
|
|
1572
|
-
import React from "react";
|
|
1573
|
-
import { createRoot } from "react-dom/client";
|
|
1574
|
-
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
1575
|
-
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
1576
|
-
import { Theme } from "@czi-sds/components";
|
|
1577
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
1578
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
1579
|
-
|
|
1580
|
-
import App from "./App";
|
|
1581
|
-
|
|
1582
|
-
const container = document.getElementById("root");
|
|
1583
|
-
const root = createRoot(container!);
|
|
1584
|
-
|
|
1585
|
-
const RootApp = () => {
|
|
1586
|
-
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
1587
|
-
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
1588
|
-
|
|
1589
|
-
return (
|
|
1590
|
-
<StyledEngineProvider injectFirst>
|
|
1591
|
-
<ThemeProvider theme={theme}>
|
|
1592
|
-
<EmotionThemeProvider theme={theme}>
|
|
1593
|
-
<CssBaseline />
|
|
1594
|
-
<App />
|
|
1595
|
-
</EmotionThemeProvider>
|
|
1596
|
-
</ThemeProvider>
|
|
1597
|
-
</StyledEngineProvider>
|
|
1598
|
-
);
|
|
1599
|
-
};
|
|
1600
|
-
|
|
1601
|
-
root.render(
|
|
1602
|
-
<React.StrictMode>
|
|
1603
|
-
<RootApp />
|
|
1604
|
-
</React.StrictMode>
|
|
1605
|
-
);
|
|
1606
|
-
```
|
|
1607
|
-
|
|
1608
|
-
**/public/index.html**
|
|
1609
|
-
|
|
1610
|
-
```html
|
|
1611
|
-
<!doctype html>
|
|
1612
|
-
<html lang="en">
|
|
1613
|
-
<head>
|
|
1614
|
-
<meta charset="UTF-8" />
|
|
1615
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
1616
|
-
<title>Button</title>
|
|
1617
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
1618
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
1619
|
-
<link
|
|
1620
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
1621
|
-
rel="stylesheet"
|
|
1622
|
-
/>
|
|
1623
|
-
<link
|
|
1624
|
-
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
1625
|
-
rel="stylesheet"
|
|
1626
|
-
/>
|
|
1627
|
-
</head>
|
|
1628
|
-
<body>
|
|
1629
|
-
<div id="root"></div>
|
|
1630
|
-
</body>
|
|
1631
|
-
</html>
|
|
1632
|
-
```
|
|
1633
|
-
|
|
1634
|
-
**/package.json**
|
|
1635
|
-
|
|
1636
|
-
```json
|
|
1637
|
-
{
|
|
1638
|
-
"dependencies": {
|
|
1639
|
-
"react": "^18.0.0",
|
|
1640
|
-
"react-dom": "^18.0.0",
|
|
1641
|
-
"react-scripts": "^4.0.0"
|
|
1642
|
-
},
|
|
1643
|
-
"devDependencies": {
|
|
1644
|
-
"@types/react": "^18.0.0",
|
|
1645
|
-
"@types/react-dom": "^18.0.0",
|
|
1646
|
-
"typescript": "^4.0.0"
|
|
1647
|
-
},
|
|
1648
|
-
"main": "/index.tsx"
|
|
1649
|
-
}
|
|
1650
|
-
```
|
|
1651
|
-
|
|
1652
|
-
---
|
|
1653
|
-
|
|
1654
|
-
#### Icon Button
|
|
1655
|
-
|
|
1656
|
-
This example shows a `icon` style button component.
|
|
1657
|
-
|
|
1658
|
-
**/styles.css**
|
|
1659
|
-
|
|
1660
|
-
```css
|
|
1661
|
-
body {
|
|
1662
|
-
font-size: 13px;
|
|
1663
|
-
font-weight: 400;
|
|
1664
|
-
letter-spacing: 0.08px;
|
|
1665
|
-
line-height: 20px;
|
|
1666
|
-
text-transform: none;
|
|
1667
|
-
font-family: "Inter", sans-serif;
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
h1 {
|
|
1671
|
-
font-size: 1.5rem;
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
.app {
|
|
1675
|
-
padding: 20px;
|
|
1676
|
-
}
|
|
1677
|
-
```
|
|
1678
|
-
|
|
1679
|
-
**tsconfig.json**
|
|
1680
|
-
|
|
1681
|
-
```json
|
|
1682
|
-
{
|
|
1683
|
-
"include": ["./**/*"],
|
|
1684
|
-
"compilerOptions": {
|
|
1685
|
-
"strict": true,
|
|
1686
|
-
"esModuleInterop": true,
|
|
1687
|
-
"lib": ["dom", "es2015"],
|
|
1688
|
-
"jsx": "react-jsx"
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
```
|
|
1692
|
-
|
|
1693
|
-
**/App.tsx**
|
|
1694
|
-
|
|
1695
|
-
```tsx
|
|
1696
|
-
import { Button, Icon } from "@czi-sds/components";
|
|
1697
|
-
import "./styles.css";
|
|
1698
|
-
|
|
1699
|
-
function App() {
|
|
1700
|
-
return (
|
|
1701
|
-
<div className="app">
|
|
1702
|
-
<Button sdsType="primary" sdsStyle="icon" icon="Download" />
|
|
1703
|
-
</div>
|
|
1704
|
-
);
|
|
1705
|
-
}
|
|
1706
|
-
|
|
1707
|
-
export default App;
|
|
1708
|
-
```
|
|
1709
|
-
|
|
1710
|
-
**/index.tsx**
|
|
1711
|
-
|
|
1712
|
-
```tsx
|
|
1713
|
-
import React from "react";
|
|
1714
|
-
import { createRoot } from "react-dom/client";
|
|
1715
|
-
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
1716
|
-
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
1717
|
-
import { Theme } from "@czi-sds/components";
|
|
1718
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
1719
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
1720
|
-
|
|
1721
|
-
import App from "./App";
|
|
1722
|
-
|
|
1723
|
-
const container = document.getElementById("root");
|
|
1724
|
-
const root = createRoot(container!);
|
|
1725
|
-
|
|
1726
|
-
const RootApp = () => {
|
|
1727
|
-
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
1728
|
-
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
1729
|
-
|
|
1730
|
-
return (
|
|
1731
|
-
<StyledEngineProvider injectFirst>
|
|
1732
|
-
<ThemeProvider theme={theme}>
|
|
1733
|
-
<EmotionThemeProvider theme={theme}>
|
|
1734
|
-
<CssBaseline />
|
|
1735
|
-
<App />
|
|
1736
|
-
</EmotionThemeProvider>
|
|
1737
|
-
</ThemeProvider>
|
|
1738
|
-
</StyledEngineProvider>
|
|
1739
|
-
);
|
|
1740
|
-
};
|
|
1741
|
-
|
|
1742
|
-
root.render(
|
|
1743
|
-
<React.StrictMode>
|
|
1744
|
-
<RootApp />
|
|
1745
|
-
</React.StrictMode>
|
|
1746
|
-
);
|
|
1747
|
-
```
|
|
1874
|
+
Storybook
|
|
1748
1875
|
|
|
1749
|
-
|
|
1876
|
+
---
|
|
1750
1877
|
|
|
1751
|
-
|
|
1752
|
-
<!doctype html>
|
|
1753
|
-
<html lang="en">
|
|
1754
|
-
<head>
|
|
1755
|
-
<meta charset="UTF-8" />
|
|
1756
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
1757
|
-
<title>Button</title>
|
|
1758
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
1759
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
1760
|
-
<link
|
|
1761
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
1762
|
-
rel="stylesheet"
|
|
1763
|
-
/>
|
|
1764
|
-
<link
|
|
1765
|
-
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
1766
|
-
rel="stylesheet"
|
|
1767
|
-
/>
|
|
1768
|
-
</head>
|
|
1769
|
-
<body>
|
|
1770
|
-
<div id="root"></div>
|
|
1771
|
-
</body>
|
|
1772
|
-
</html>
|
|
1773
|
-
```
|
|
1774
|
-
|
|
1775
|
-
**/package.json**
|
|
1776
|
-
|
|
1777
|
-
```json
|
|
1778
|
-
{
|
|
1779
|
-
"dependencies": {
|
|
1780
|
-
"react": "^18.0.0",
|
|
1781
|
-
"react-dom": "^18.0.0",
|
|
1782
|
-
"react-scripts": "^4.0.0"
|
|
1783
|
-
},
|
|
1784
|
-
"devDependencies": {
|
|
1785
|
-
"@types/react": "^18.0.0",
|
|
1786
|
-
"@types/react-dom": "^18.0.0",
|
|
1787
|
-
"typescript": "^4.0.0"
|
|
1788
|
-
},
|
|
1789
|
-
"main": "/index.tsx"
|
|
1790
|
-
}
|
|
1791
|
-
```
|
|
1792
|
-
|
|
1793
|
-
---
|
|
1794
|
-
|
|
1795
|
-
---
|
|
1796
|
-
|
|
1797
|
-
## ButtonDropdown
|
|
1798
|
-
|
|
1799
|
-
### SDS Source Code
|
|
1800
|
-
|
|
1801
|
-
The component's source code in the SDS codebase can be found here.
|
|
1802
|
-
|
|
1803
|
-
### SDS vs MUI
|
|
1804
|
-
|
|
1805
|
-
The SDS `ButtonDropdown` component is just the regular `Button` component, with the `chevronDown` icon added at the end of the button after the label text, via the MUI `endIcon` prop. Additionally, `ButtonDropdown` requires a `startIcon`. In SDS, both the `endIcon` and `startIcon` props take the `Icon` component, which references the specific icon to call as one of its props, like so:
|
|
1806
|
-
|
|
1807
|
-
`startIcon={<Icon sdsIcon="download" sdsSize="s" sdsType="button" />}`
|
|
1808
|
-
|
|
1809
|
-
whereas MUI expects the prop to receive an individual icon as its own component (for example`startIcon={<DeleteIcon />}`).
|
|
1810
|
-
|
|
1811
|
-
Since `ButtonIcon` is very similar to SDS's `Button` component, similar caveats apply in terms of the MUI props. The following props are available to MUI's `Button` component, but produce no effect (or unexpected effects) for SDS's `ButtonIcon` component, so it is recommended to not use them:
|
|
1812
|
-
|
|
1813
|
-
- **`variant`\*\***:\*\* This prop is intended to set the `Button` to either `text` only, `contained`, or `outlined`. With SDS's `ButtonIcon`, however, they do not function as described in the MUI documentation; however, similar effects, specific to SDS's styles, can be achieved through a combination of the SDS-only `sdsStyle` and `sdsType` props (see below).
|
|
1814
|
-
- **`color`\*\***:\*\* This prop doesn't work as expected for SDS's `ButtonIcon`, which doesn't support colors or intents. The `sdsType` prop can be used to set the button as `primary` or `secondary`, though.
|
|
1815
|
-
- **`size`\*\***:\*\* This prop is not supported for SDS's `ButtonIcon`
|
|
1816
|
-
- **`disableElevation`\*\***:\*\* The SDS `ButtonIcon` component doesn't have a visual "elevation" or shadowed treatment by default (which this prop disables for MUI's `Button`). However, setting `disableElevation={false}` will not render the MUI default elevation treatment.
|
|
1817
|
-
|
|
1818
|
-
SDS's `ButtonIcon` has additional props to allow flexibility while maintaining the SDS styles:
|
|
1819
|
-
|
|
1820
|
-
- **`sdsStyle`\*\***:\*\* takes `minimal` (default), `rounded`, or `square` as values
|
|
1821
|
-
- **`sdsType`\*\***:\*\* takes `primary` (default, filled) or `secondary` (outlined) as values
|
|
1822
|
-
|
|
1823
|
-
### MUI Documentation
|
|
1824
|
-
|
|
1825
|
-
Documentation for the underlying MUI component can be found here.
|
|
1826
|
-
|
|
1827
|
-
### Props
|
|
1828
|
-
|
|
1829
|
-
Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
|
|
1830
|
-
|
|
1831
|
-
| Name | Type | Default | Description |
|
|
1832
|
-
| -------------- | -------------------- | ----------------------------------- | ------------------------------------------ | --------------------------------------------- | -------------------- |
|
|
1833
|
-
| `icon` | `SDSIcon | React.ReactElement<CustomSVGProps>` | `-` | An `icon` element placed before the children. |
|
|
1834
|
-
| `sdsStyle` | `"icon"` ` | "rounded"` ` | "square"` | `-` | Style of the button. |
|
|
1835
|
-
| `sdsType` | `"primary" | "secondary"` | `-` | Type of the button. |
|
|
1836
|
-
| `sdsSize` | `"small" | "medium" | "large"` | `"medium"` | Size of the icon. |
|
|
1837
|
-
| `sdsIconProps` | `Partial<IconProps>` | `-` | Props for the icon if an SDS icon is used. |
|
|
1838
|
-
|
|
1839
|
-
### Code examples
|
|
1840
|
-
|
|
1841
|
-
#### **Default ButtonDropdown**
|
|
1842
|
-
|
|
1843
|
-
This example has the minimum props needed for the `ButtonDropdown` component.
|
|
1844
|
-
|
|
1845
|
-
**/styles.css**
|
|
1846
|
-
|
|
1847
|
-
```css
|
|
1848
|
-
body {
|
|
1849
|
-
font-size: 13px;
|
|
1850
|
-
font-weight: 400;
|
|
1851
|
-
letter-spacing: 0.08px;
|
|
1852
|
-
line-height: 20px;
|
|
1853
|
-
text-transform: none;
|
|
1854
|
-
font-family: "Inter", sans-serif;
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
h1 {
|
|
1858
|
-
font-size: 1.5rem;
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
.app {
|
|
1862
|
-
padding: 20px;
|
|
1863
|
-
}
|
|
1864
|
-
```
|
|
1865
|
-
|
|
1866
|
-
**tsconfig.json**
|
|
1867
|
-
|
|
1868
|
-
```json
|
|
1869
|
-
{
|
|
1870
|
-
"include": ["./**/*"],
|
|
1871
|
-
"compilerOptions": {
|
|
1872
|
-
"strict": true,
|
|
1873
|
-
"esModuleInterop": true,
|
|
1874
|
-
"lib": ["dom", "es2015"],
|
|
1875
|
-
"jsx": "react-jsx"
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
```
|
|
1879
|
-
|
|
1880
|
-
**/App.tsx**
|
|
1881
|
-
|
|
1882
|
-
```tsx
|
|
1883
|
-
import { ButtonDropdown } from "@czi-sds/components";
|
|
1884
|
-
import "./styles.css";
|
|
1885
|
-
|
|
1886
|
-
function App() {
|
|
1887
|
-
return (
|
|
1888
|
-
<div className="app">
|
|
1889
|
-
<ButtonDropdown sdsType="primary" sdsStyle="square">
|
|
1890
|
-
Label
|
|
1891
|
-
</ButtonDropdown>
|
|
1892
|
-
</div>
|
|
1893
|
-
);
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
export default App;
|
|
1897
|
-
```
|
|
1898
|
-
|
|
1899
|
-
**/index.tsx**
|
|
1900
|
-
|
|
1901
|
-
```tsx
|
|
1902
|
-
import React from "react";
|
|
1903
|
-
import { createRoot } from "react-dom/client";
|
|
1904
|
-
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
1905
|
-
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
1906
|
-
import { Theme } from "@czi-sds/components";
|
|
1907
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
1908
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
1909
|
-
|
|
1910
|
-
import App from "./App";
|
|
1911
|
-
|
|
1912
|
-
const container = document.getElementById("root");
|
|
1913
|
-
const root = createRoot(container!);
|
|
1914
|
-
|
|
1915
|
-
const RootApp = () => {
|
|
1916
|
-
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
1917
|
-
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
1918
|
-
|
|
1919
|
-
return (
|
|
1920
|
-
<StyledEngineProvider injectFirst>
|
|
1921
|
-
<ThemeProvider theme={theme}>
|
|
1922
|
-
<EmotionThemeProvider theme={theme}>
|
|
1923
|
-
<CssBaseline />
|
|
1924
|
-
<App />
|
|
1925
|
-
</EmotionThemeProvider>
|
|
1926
|
-
</ThemeProvider>
|
|
1927
|
-
</StyledEngineProvider>
|
|
1928
|
-
);
|
|
1929
|
-
};
|
|
1930
|
-
|
|
1931
|
-
root.render(
|
|
1932
|
-
<React.StrictMode>
|
|
1933
|
-
<RootApp />
|
|
1934
|
-
</React.StrictMode>
|
|
1935
|
-
);
|
|
1936
|
-
```
|
|
1937
|
-
|
|
1938
|
-
**/public/index.html**
|
|
1939
|
-
|
|
1940
|
-
```html
|
|
1941
|
-
<!doctype html>
|
|
1942
|
-
<html lang="en">
|
|
1943
|
-
<head>
|
|
1944
|
-
<meta charset="UTF-8" />
|
|
1945
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
1946
|
-
<title>Button</title>
|
|
1947
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
1948
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
1949
|
-
<link
|
|
1950
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
1951
|
-
rel="stylesheet"
|
|
1952
|
-
/>
|
|
1953
|
-
<link
|
|
1954
|
-
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
1955
|
-
rel="stylesheet"
|
|
1956
|
-
/>
|
|
1957
|
-
</head>
|
|
1958
|
-
<body>
|
|
1959
|
-
<div id="root"></div>
|
|
1960
|
-
</body>
|
|
1961
|
-
</html>
|
|
1962
|
-
```
|
|
1963
|
-
|
|
1964
|
-
**/package.json**
|
|
1965
|
-
|
|
1966
|
-
```json
|
|
1967
|
-
{
|
|
1968
|
-
"dependencies": {
|
|
1969
|
-
"react": "^18.0.0",
|
|
1970
|
-
"react-dom": "^18.0.0",
|
|
1971
|
-
"react-scripts": "^4.0.0"
|
|
1972
|
-
},
|
|
1973
|
-
"devDependencies": {
|
|
1974
|
-
"@types/react": "^18.0.0",
|
|
1975
|
-
"@types/react-dom": "^18.0.0",
|
|
1976
|
-
"typescript": "^4.0.0"
|
|
1977
|
-
},
|
|
1978
|
-
"main": "/index.tsx"
|
|
1979
|
-
}
|
|
1980
|
-
```
|
|
1981
|
-
|
|
1982
|
-
---
|
|
1983
|
-
|
|
1984
|
-
#### ButtonDropdown with a start icon
|
|
1985
|
-
|
|
1986
|
-
This example shows how to incorporate a starting icon within a `ButtonDropdown` component.
|
|
1987
|
-
|
|
1988
|
-
**/styles.css**
|
|
1989
|
-
|
|
1990
|
-
```css
|
|
1991
|
-
body {
|
|
1992
|
-
font-size: 13px;
|
|
1993
|
-
font-weight: 400;
|
|
1994
|
-
letter-spacing: 0.08px;
|
|
1995
|
-
line-height: 20px;
|
|
1996
|
-
text-transform: none;
|
|
1997
|
-
font-family: "Inter", sans-serif;
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
h1 {
|
|
2001
|
-
font-size: 1.5rem;
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
.app {
|
|
2005
|
-
padding: 20px;
|
|
2006
|
-
}
|
|
2007
|
-
```
|
|
2008
|
-
|
|
2009
|
-
**tsconfig.json**
|
|
2010
|
-
|
|
2011
|
-
```json
|
|
2012
|
-
{
|
|
2013
|
-
"include": ["./**/*"],
|
|
2014
|
-
"compilerOptions": {
|
|
2015
|
-
"strict": true,
|
|
2016
|
-
"esModuleInterop": true,
|
|
2017
|
-
"lib": ["dom", "es2015"],
|
|
2018
|
-
"jsx": "react-jsx"
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
```
|
|
2022
|
-
|
|
2023
|
-
**/App.tsx**
|
|
2024
|
-
|
|
2025
|
-
```tsx
|
|
2026
|
-
import { ButtonDropdown, Icon } from "@czi-sds/components";
|
|
2027
|
-
import "./styles.css";
|
|
2028
|
-
|
|
2029
|
-
function App() {
|
|
2030
|
-
return (
|
|
2031
|
-
<div className="app">
|
|
2032
|
-
<ButtonDropdown
|
|
2033
|
-
icon={<Icon sdsIcon="Bacteria" sdsSize="s" sdsType="button" />}
|
|
2034
|
-
sdsType="primary"
|
|
2035
|
-
sdsStyle="square"
|
|
2036
|
-
>
|
|
2037
|
-
Bacteria Types
|
|
2038
|
-
</ButtonDropdown>
|
|
2039
|
-
</div>
|
|
2040
|
-
);
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
export default App;
|
|
2044
|
-
```
|
|
2045
|
-
|
|
2046
|
-
**/index.tsx**
|
|
2047
|
-
|
|
2048
|
-
```tsx
|
|
2049
|
-
import React from "react";
|
|
2050
|
-
import { createRoot } from "react-dom/client";
|
|
2051
|
-
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
2052
|
-
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
2053
|
-
import { Theme } from "@czi-sds/components";
|
|
2054
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
2055
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
2056
|
-
|
|
2057
|
-
import App from "./App";
|
|
2058
|
-
|
|
2059
|
-
const container = document.getElementById("root");
|
|
2060
|
-
const root = createRoot(container!);
|
|
2061
|
-
|
|
2062
|
-
const RootApp = () => {
|
|
2063
|
-
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
2064
|
-
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
2065
|
-
|
|
2066
|
-
return (
|
|
2067
|
-
<StyledEngineProvider injectFirst>
|
|
2068
|
-
<ThemeProvider theme={theme}>
|
|
2069
|
-
<EmotionThemeProvider theme={theme}>
|
|
2070
|
-
<CssBaseline />
|
|
2071
|
-
<App />
|
|
2072
|
-
</EmotionThemeProvider>
|
|
2073
|
-
</ThemeProvider>
|
|
2074
|
-
</StyledEngineProvider>
|
|
2075
|
-
);
|
|
2076
|
-
};
|
|
2077
|
-
|
|
2078
|
-
root.render(
|
|
2079
|
-
<React.StrictMode>
|
|
2080
|
-
<RootApp />
|
|
2081
|
-
</React.StrictMode>
|
|
2082
|
-
);
|
|
2083
|
-
```
|
|
2084
|
-
|
|
2085
|
-
**/public/index.html**
|
|
2086
|
-
|
|
2087
|
-
```html
|
|
2088
|
-
<!doctype html>
|
|
2089
|
-
<html lang="en">
|
|
2090
|
-
<head>
|
|
2091
|
-
<meta charset="UTF-8" />
|
|
2092
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
2093
|
-
<title>Button</title>
|
|
2094
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
2095
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
2096
|
-
<link
|
|
2097
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
2098
|
-
rel="stylesheet"
|
|
2099
|
-
/>
|
|
2100
|
-
<link
|
|
2101
|
-
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
2102
|
-
rel="stylesheet"
|
|
2103
|
-
/>
|
|
2104
|
-
</head>
|
|
2105
|
-
<body>
|
|
2106
|
-
<div id="root"></div>
|
|
2107
|
-
</body>
|
|
2108
|
-
</html>
|
|
2109
|
-
```
|
|
2110
|
-
|
|
2111
|
-
**/package.json**
|
|
2112
|
-
|
|
2113
|
-
```json
|
|
2114
|
-
{
|
|
2115
|
-
"dependencies": {
|
|
2116
|
-
"react": "^18.0.0",
|
|
2117
|
-
"react-dom": "^18.0.0",
|
|
2118
|
-
"react-scripts": "^4.0.0"
|
|
2119
|
-
},
|
|
2120
|
-
"devDependencies": {
|
|
2121
|
-
"@types/react": "^18.0.0",
|
|
2122
|
-
"@types/react-dom": "^18.0.0",
|
|
2123
|
-
"typescript": "^4.0.0"
|
|
2124
|
-
},
|
|
2125
|
-
"main": "/index.tsx"
|
|
2126
|
-
}
|
|
2127
|
-
```
|
|
2128
|
-
|
|
2129
|
-
---
|
|
2130
|
-
|
|
2131
|
-
---
|
|
2132
|
-
|
|
2133
|
-
## ButtonToggle
|
|
2134
|
-
|
|
2135
|
-
### SDS Source Code
|
|
2136
|
-
|
|
2137
|
-
The component's source code in the SDS codebase can be found here.
|
|
2138
|
-
|
|
2139
|
-
### MUI Documentation
|
|
2140
|
-
|
|
2141
|
-
Documentation for the underlying MUI component can be found here.
|
|
2142
|
-
|
|
2143
|
-
### Props
|
|
2144
|
-
|
|
2145
|
-
Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
|
|
2146
|
-
|
|
2147
|
-
| Name | Type | Default | Description |
|
|
2148
|
-
| ---------- | ---------- | ----------------------------------- | ---------------------------------------------- | -------------------------------------------------- | ----------------- |
|
|
2149
|
-
| `icon` | `SDSIcon | React.ReactElement<CustomSVGProps>` | `-` | The `icon` element displayed within the component. |
|
|
2150
|
-
| `sdsStage` | `"on"` ` | "off"` | `off` | Controls the toggle stage. |
|
|
2151
|
-
| `sdsType` | `"primary" | "secondary"` | `-` | Type of the button. |
|
|
2152
|
-
| `sdsSize` | `"small" | "medium" | "large"` | `"medium"` | Size of the icon. |
|
|
2153
|
-
| `disabled` | `bool` | `false` | Disables the toggle button when set to `true`. |
|
|
2154
|
-
|
|
2155
|
-
### Code examples
|
|
2156
|
-
|
|
2157
|
-
#### **Default ButtonToggle**
|
|
2158
|
-
|
|
2159
|
-
This example has the minimum props needed for the `ButtonToggle` component.
|
|
2160
|
-
|
|
2161
|
-
**/styles.css**
|
|
2162
|
-
|
|
2163
|
-
```css
|
|
2164
|
-
body {
|
|
2165
|
-
font-size: 13px;
|
|
2166
|
-
font-weight: 400;
|
|
2167
|
-
letter-spacing: 0.08px;
|
|
2168
|
-
line-height: 20px;
|
|
2169
|
-
text-transform: none;
|
|
2170
|
-
font-family: "Inter", sans-serif;
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
|
-
h1 {
|
|
2174
|
-
font-size: 1.5rem;
|
|
2175
|
-
}
|
|
2176
|
-
|
|
2177
|
-
.app {
|
|
2178
|
-
padding: 20px;
|
|
2179
|
-
}
|
|
2180
|
-
```
|
|
2181
|
-
|
|
2182
|
-
**tsconfig.json**
|
|
2183
|
-
|
|
2184
|
-
```json
|
|
2185
|
-
{
|
|
2186
|
-
"include": ["./**/*"],
|
|
2187
|
-
"compilerOptions": {
|
|
2188
|
-
"strict": true,
|
|
2189
|
-
"esModuleInterop": true,
|
|
2190
|
-
"lib": ["dom", "es2015"],
|
|
2191
|
-
"jsx": "react-jsx"
|
|
2192
|
-
}
|
|
2193
|
-
}
|
|
2194
|
-
```
|
|
2195
|
-
|
|
2196
|
-
**/App.tsx**
|
|
2197
|
-
|
|
2198
|
-
```tsx
|
|
2199
|
-
import * as React from "react";
|
|
2200
|
-
import { ButtonToggle } from "@czi-sds/components";
|
|
2201
|
-
import "./styles.css";
|
|
2202
|
-
|
|
2203
|
-
function App() {
|
|
2204
|
-
const [toggle, setToggle] = React.useState(0);
|
|
2205
|
-
|
|
2206
|
-
return (
|
|
2207
|
-
<div className="app">
|
|
2208
|
-
<ButtonToggle
|
|
2209
|
-
icon="InfoCircle"
|
|
2210
|
-
sdsStage={toggle ? "on" : "off"}
|
|
2211
|
-
onClick={() => setToggle((prev) => !prev)}
|
|
2212
|
-
>
|
|
2213
|
-
Label
|
|
2214
|
-
</ButtonToggle>
|
|
2215
|
-
</div>
|
|
2216
|
-
);
|
|
2217
|
-
}
|
|
2218
|
-
|
|
2219
|
-
export default App;
|
|
2220
|
-
```
|
|
2221
|
-
|
|
2222
|
-
**/index.tsx**
|
|
2223
|
-
|
|
2224
|
-
```tsx
|
|
2225
|
-
import React from "react";
|
|
2226
|
-
import { createRoot } from "react-dom/client";
|
|
2227
|
-
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
2228
|
-
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
2229
|
-
import { Theme } from "@czi-sds/components";
|
|
2230
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
2231
|
-
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
2232
|
-
|
|
2233
|
-
import App from "./App";
|
|
2234
|
-
|
|
2235
|
-
const container = document.getElementById("root");
|
|
2236
|
-
const root = createRoot(container!);
|
|
2237
|
-
|
|
2238
|
-
const RootApp = () => {
|
|
2239
|
-
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
2240
|
-
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
2241
|
-
|
|
2242
|
-
return (
|
|
2243
|
-
<StyledEngineProvider injectFirst>
|
|
2244
|
-
<ThemeProvider theme={theme}>
|
|
2245
|
-
<EmotionThemeProvider theme={theme}>
|
|
2246
|
-
<CssBaseline />
|
|
2247
|
-
<App />
|
|
2248
|
-
</EmotionThemeProvider>
|
|
2249
|
-
</ThemeProvider>
|
|
2250
|
-
</StyledEngineProvider>
|
|
2251
|
-
);
|
|
2252
|
-
};
|
|
2253
|
-
|
|
2254
|
-
root.render(
|
|
2255
|
-
<React.StrictMode>
|
|
2256
|
-
<RootApp />
|
|
2257
|
-
</React.StrictMode>
|
|
2258
|
-
);
|
|
2259
|
-
```
|
|
2260
|
-
|
|
2261
|
-
**/public/index.html**
|
|
2262
|
-
|
|
2263
|
-
```html
|
|
2264
|
-
<!doctype html>
|
|
2265
|
-
<html lang="en">
|
|
2266
|
-
<head>
|
|
2267
|
-
<meta charset="UTF-8" />
|
|
2268
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
2269
|
-
<title>Button</title>
|
|
2270
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
2271
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
2272
|
-
<link
|
|
2273
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
2274
|
-
rel="stylesheet"
|
|
2275
|
-
/>
|
|
2276
|
-
<link
|
|
2277
|
-
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
2278
|
-
rel="stylesheet"
|
|
2279
|
-
/>
|
|
2280
|
-
</head>
|
|
2281
|
-
<body>
|
|
2282
|
-
<div id="root"></div>
|
|
2283
|
-
</body>
|
|
2284
|
-
</html>
|
|
2285
|
-
```
|
|
2286
|
-
|
|
2287
|
-
**/package.json**
|
|
2288
|
-
|
|
2289
|
-
```json
|
|
2290
|
-
{
|
|
2291
|
-
"dependencies": {
|
|
2292
|
-
"react": "^18.0.0",
|
|
2293
|
-
"react-dom": "^18.0.0",
|
|
2294
|
-
"react-scripts": "^4.0.0"
|
|
2295
|
-
},
|
|
2296
|
-
"devDependencies": {
|
|
2297
|
-
"@types/react": "^18.0.0",
|
|
2298
|
-
"@types/react-dom": "^18.0.0",
|
|
2299
|
-
"typescript": "^4.0.0"
|
|
2300
|
-
},
|
|
2301
|
-
"main": "/index.tsx"
|
|
2302
|
-
}
|
|
2303
|
-
```
|
|
1878
|
+
### ButtonDropdown
|
|
2304
1879
|
|
|
2305
|
-
|
|
1880
|
+
Storybook
|