@iress-oss/ids-mcp-server 6.0.0-alpha.1-canary-20251204032753-fe18cab → 6.0.0-alpha.1-canary-20251204040305-3639454
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/generated/docs/components_components-alert-docs.md +1054 -0
- package/generated/docs/components_components-autocomplete-docs.md +3304 -0
- package/generated/docs/components_components-autocomplete-recipes-docs.md +98 -0
- package/generated/docs/components_components-badge-docs.md +312 -0
- package/generated/docs/components_components-button-docs.md +2339 -0
- package/generated/docs/components_components-buttongroup-docs.md +980 -0
- package/generated/docs/components_components-card-docs.md +1970 -0
- package/generated/docs/components_components-checkbox-docs.md +1083 -0
- package/generated/docs/components_components-checkboxgroup-docs.md +1597 -0
- package/generated/docs/components_components-checkboxgroup-recipes-docs.md +209 -0
- package/generated/docs/components_components-col-docs.md +755 -0
- package/generated/docs/components_components-container-docs.md +172 -0
- package/generated/docs/components_components-divider-docs.md +235 -0
- package/generated/docs/components_components-expander-docs.md +428 -0
- package/generated/docs/components_components-field-docs.md +3345 -0
- package/generated/docs/components_components-filter-docs.md +4091 -0
- package/generated/docs/components_components-hide-docs.md +450 -0
- package/generated/docs/components_components-icon-docs.md +1017 -0
- package/generated/docs/components_components-image-docs.md +168 -0
- package/generated/docs/components_components-inline-docs.md +1962 -0
- package/generated/docs/components_components-input-docs.md +1388 -0
- package/generated/docs/components_components-input-recipes-docs.md +349 -0
- package/generated/docs/components_components-inputcurrency-docs.md +636 -0
- package/generated/docs/components_components-inputcurrency-recipes-docs.md +208 -0
- package/generated/docs/components_components-introduction-docs.md +448 -0
- package/generated/docs/components_components-label-docs.md +229 -0
- package/generated/docs/components_components-link-docs.md +454 -0
- package/generated/docs/components_components-menu-docs.md +2219 -0
- package/generated/docs/components_components-menu-menuitem-docs.md +1455 -0
- package/generated/docs/components_components-modal-docs.md +2002 -0
- package/generated/docs/components_components-panel-docs.md +342 -0
- package/generated/docs/components_components-placeholder-docs.md +98 -0
- package/generated/docs/components_components-popover-docs.md +1631 -0
- package/generated/docs/components_components-popover-recipes-docs.md +537 -0
- package/generated/docs/components_components-progress-docs.md +128 -0
- package/generated/docs/components_components-provider-docs.md +123 -0
- package/generated/docs/components_components-radio-docs.md +499 -0
- package/generated/docs/components_components-radiogroup-docs.md +1573 -0
- package/generated/docs/components_components-readonly-docs.md +277 -0
- package/generated/docs/components_components-richselect-docs.md +6101 -0
- package/generated/docs/components_components-row-docs.md +2172 -0
- package/generated/docs/components_components-select-docs.md +1110 -0
- package/generated/docs/components_components-skeleton-docs.md +467 -0
- package/generated/docs/components_components-skeleton-recipes-docs.md +110 -0
- package/generated/docs/components_components-skiplink-docs.md +220 -0
- package/generated/docs/components_components-slideout-docs.md +1910 -0
- package/generated/docs/components_components-slider-docs.md +1284 -0
- package/generated/docs/components_components-spinner-docs.md +90 -0
- package/generated/docs/components_components-stack-docs.md +730 -0
- package/generated/docs/components_components-table-docs.md +4038 -0
- package/generated/docs/components_components-tabset-docs.md +955 -0
- package/generated/docs/components_components-tabset-tab-docs.md +342 -0
- package/generated/docs/components_components-tag-docs.md +410 -0
- package/generated/docs/components_components-text-docs.md +593 -0
- package/generated/docs/components_components-toaster-docs.md +451 -0
- package/generated/docs/components_components-toggle-docs.md +513 -0
- package/generated/docs/components_components-tooltip-docs.md +564 -0
- package/generated/docs/components_components-validationmessage-docs.md +608 -0
- package/generated/docs/components_contact-us-docs.md +9 -0
- package/generated/docs/components_foundations-accessibility-docs.md +33 -0
- package/generated/docs/components_foundations-consistency-docs.md +44 -0
- package/generated/docs/components_foundations-content-docs.md +18 -0
- package/generated/docs/components_foundations-introduction-docs.md +17 -0
- package/generated/docs/components_foundations-principles-docs.md +60 -0
- package/generated/docs/components_foundations-responsive-layout-docs.md +2692 -0
- package/generated/docs/components_foundations-user-experience-docs.md +53 -0
- package/generated/docs/components_foundations-visual-design-docs.md +39 -0
- package/generated/docs/components_foundations-z-index-stacking-docs.md +288 -0
- package/generated/docs/components_frequently-asked-questions-docs.md +44 -0
- package/generated/docs/components_get-started-develop-docs.md +47 -0
- package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
- package/generated/docs/components_introduction-docs.md +85 -0
- package/generated/docs/components_patterns-form-docs.md +2469 -0
- package/generated/docs/components_patterns-form-recipes-docs.md +1597 -0
- package/generated/docs/components_patterns-introduction-docs.md +31 -0
- package/generated/docs/components_patterns-loading-docs.md +1908 -0
- package/generated/docs/components_patterns-shadow-docs.md +195 -0
- package/generated/docs/components_resources-code-katas-docs.md +25 -0
- package/generated/docs/components_resources-introduction-docs.md +28 -0
- package/generated/docs/components_resources-mcp-server-docs.md +23 -0
- package/generated/docs/components_resources-migration-guides-from-v4-to-v5-docs.md +142 -0
- package/generated/docs/components_styling-props-colour-docs.md +91 -0
- package/generated/docs/components_styling-props-elevation-docs.md +69 -0
- package/generated/docs/components_styling-props-radius-docs.md +63 -0
- package/generated/docs/components_styling-props-reference-docs.md +160 -0
- package/generated/docs/components_styling-props-screen-readers-docs.md +66 -0
- package/generated/docs/components_styling-props-sizing-docs.md +217 -0
- package/generated/docs/components_styling-props-spacing-docs.md +545 -0
- package/generated/docs/components_styling-props-typography-docs.md +66 -0
- package/generated/docs/components_versions-docs.md +14 -0
- package/generated/docs/guidelines.md +3083 -0
- package/generated/docs/introduction-docs.md +37 -0
- package/generated/docs/tokens_colour-docs.md +479 -0
- package/generated/docs/tokens_elevation-docs.md +39 -0
- package/generated/docs/tokens_introduction-docs.md +150 -0
- package/generated/docs/tokens_radius-docs.md +67 -0
- package/generated/docs/tokens_spacing-docs.md +87 -0
- package/generated/docs/tokens_typography-docs.md +305 -0
- package/package.json +2 -2
|
@@ -0,0 +1,1597 @@
|
|
|
1
|
+
Checkbox Group
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Checkbox groups allow users to make more than one choice in a set of related options.
|
|
8
|
+
|
|
9
|
+
* * *
|
|
10
|
+
|
|
11
|
+
Updated
|
|
12
|
+
|
|
13
|
+
**Recently updated**
|
|
14
|
+
|
|
15
|
+
This component has been recently updated with new props. The props have been marked as beta. Please tell us if there are any issues.
|
|
16
|
+
|
|
17
|
+
[](./iframe.html?id=components-checkboxgroup--checkbox-children)
|
|
18
|
+
|
|
19
|
+
Lemon drizzle
|
|
20
|
+
|
|
21
|
+
Victoria Sponge
|
|
22
|
+
|
|
23
|
+
Carrot Cake
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<IressCheckboxGroup name\="let-them-eat-cake"\>
|
|
28
|
+
<IressCheckbox value\="lemon-drizzle"\>
|
|
29
|
+
Lemon drizzle </IressCheckbox\>
|
|
30
|
+
<IressCheckbox value\="victoria-sponge"\>
|
|
31
|
+
Victoria Sponge </IressCheckbox\>
|
|
32
|
+
<IressCheckbox value\="carrot-cake"\>
|
|
33
|
+
Carrot Cake </IressCheckbox\>
|
|
34
|
+
</IressCheckboxGroup\>
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Props
|
|
39
|
+
-----
|
|
40
|
+
|
|
41
|
+
| Name | Description | Default | Control |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| children |
|
|
44
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
45
|
+
|
|
46
|
+
ReactNode
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
| \- | \- |
|
|
51
|
+
| defaultValue |
|
|
52
|
+
|
|
53
|
+
Value of checkbox group when in uncontrolled mode.
|
|
54
|
+
|
|
55
|
+
union
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
| \- | Set object |
|
|
60
|
+
| hiddenCheckbox |
|
|
61
|
+
|
|
62
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
63
|
+
|
|
64
|
+
boolean
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
| \- | Set boolean |
|
|
69
|
+
| layout |
|
|
70
|
+
|
|
71
|
+
Sets which of the block / inline layout options apply.
|
|
72
|
+
|
|
73
|
+
union
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
|
78
|
+
|
|
79
|
+
'stack'
|
|
80
|
+
|
|
81
|
+
|
|
|
82
|
+
|
|
83
|
+
stackblockinline
|
|
84
|
+
|
|
85
|
+
|
|
|
86
|
+
| name |
|
|
87
|
+
|
|
88
|
+
Name to be applied to all checkboxes in the group.
|
|
89
|
+
|
|
90
|
+
string
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
| \- | let-them-eat-cake |
|
|
95
|
+
| onChange |
|
|
96
|
+
|
|
97
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
98
|
+
|
|
99
|
+
(value?: T\[\]) => void
|
|
100
|
+
|
|
101
|
+
| \- | \- |
|
|
102
|
+
| readOnly |
|
|
103
|
+
|
|
104
|
+
Renders the group in a read-only state.
|
|
105
|
+
|
|
106
|
+
boolean
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
| \- | Set boolean |
|
|
111
|
+
| role |
|
|
112
|
+
|
|
113
|
+
|
|
|
114
|
+
|
|
115
|
+
'group'
|
|
116
|
+
|
|
117
|
+
| Set object |
|
|
118
|
+
| touch |
|
|
119
|
+
|
|
120
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
121
|
+
|
|
122
|
+
boolean
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
| \- | Set boolean |
|
|
127
|
+
| value |
|
|
128
|
+
|
|
129
|
+
Value of checkbox group when in controlled mode.
|
|
130
|
+
|
|
131
|
+
union
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
| \- | Set object |
|
|
136
|
+
|
|
137
|
+
Examples
|
|
138
|
+
--------
|
|
139
|
+
|
|
140
|
+
### Checkbox children
|
|
141
|
+
|
|
142
|
+
Individual checkboxes can be passed directly into `IressCheckboxGroup`.
|
|
143
|
+
|
|
144
|
+
**Note:** The `mapCheckboxGroupOptions` helper function, originally used to map options to `IressCheckbox` components, is now deprecated. Instead, you can use `array.map` to map the options to `IressCheckbox` components.
|
|
145
|
+
|
|
146
|
+
[](./iframe.html?id=components-checkboxgroup--checkbox-children)
|
|
147
|
+
|
|
148
|
+
Lemon drizzle
|
|
149
|
+
|
|
150
|
+
Victoria Sponge
|
|
151
|
+
|
|
152
|
+
Carrot Cake
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
<IressCheckboxGroup name\="let-them-eat-cake"\>
|
|
157
|
+
<IressCheckbox value\="lemon-drizzle"\>
|
|
158
|
+
Lemon drizzle </IressCheckbox\>
|
|
159
|
+
<IressCheckbox value\="victoria-sponge"\>
|
|
160
|
+
Victoria Sponge </IressCheckbox\>
|
|
161
|
+
<IressCheckbox value\="carrot-cake"\>
|
|
162
|
+
Carrot Cake </IressCheckbox\>
|
|
163
|
+
</IressCheckboxGroup\>
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### Props
|
|
168
|
+
|
|
169
|
+
| Name | Description | Default | Control |
|
|
170
|
+
| --- | --- | --- | --- |
|
|
171
|
+
| children |
|
|
172
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
173
|
+
|
|
174
|
+
ReactNode
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
| \- | \- |
|
|
179
|
+
| defaultValue |
|
|
180
|
+
|
|
181
|
+
Value of checkbox group when in uncontrolled mode.
|
|
182
|
+
|
|
183
|
+
union
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
| \- | Set object |
|
|
188
|
+
| hiddenCheckbox |
|
|
189
|
+
|
|
190
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
191
|
+
|
|
192
|
+
boolean
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
| \- | Set boolean |
|
|
197
|
+
| layout |
|
|
198
|
+
|
|
199
|
+
Sets which of the block / inline layout options apply.
|
|
200
|
+
|
|
201
|
+
union
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
|
206
|
+
|
|
207
|
+
'stack'
|
|
208
|
+
|
|
209
|
+
|
|
|
210
|
+
|
|
211
|
+
stackblockinline
|
|
212
|
+
|
|
213
|
+
|
|
|
214
|
+
| name |
|
|
215
|
+
|
|
216
|
+
Name to be applied to all checkboxes in the group.
|
|
217
|
+
|
|
218
|
+
string
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
| \- | let-them-eat-cake |
|
|
223
|
+
| onChange |
|
|
224
|
+
|
|
225
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
226
|
+
|
|
227
|
+
(value?: T\[\]) => void
|
|
228
|
+
|
|
229
|
+
| \- | \- |
|
|
230
|
+
| readOnly |
|
|
231
|
+
|
|
232
|
+
Renders the group in a read-only state.
|
|
233
|
+
|
|
234
|
+
boolean
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
| \- | Set boolean |
|
|
239
|
+
| role |
|
|
240
|
+
|
|
241
|
+
|
|
|
242
|
+
|
|
243
|
+
'group'
|
|
244
|
+
|
|
245
|
+
| Set object |
|
|
246
|
+
| touch |
|
|
247
|
+
|
|
248
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
249
|
+
|
|
250
|
+
boolean
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
| \- | Set boolean |
|
|
255
|
+
| value |
|
|
256
|
+
|
|
257
|
+
Value of checkbox group when in controlled mode.
|
|
258
|
+
|
|
259
|
+
union
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
| \- | Set object |
|
|
264
|
+
|
|
265
|
+
### Default checked
|
|
266
|
+
|
|
267
|
+
The default checked state of the checkbox children should always be set using the `defaultValue` prop (not directly on the checkbox component).
|
|
268
|
+
|
|
269
|
+
The `defaultValue` prop can contain an array of strings, numbers or booleans.
|
|
270
|
+
|
|
271
|
+
[](./iframe.html?id=components-checkboxgroup--default-checked)
|
|
272
|
+
|
|
273
|
+
Lemon drizzle
|
|
274
|
+
|
|
275
|
+
Victoria Sponge
|
|
276
|
+
|
|
277
|
+
Carrot Cake
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
<IressCheckboxGroup
|
|
282
|
+
defaultValue\={\[
|
|
283
|
+
'lemon-drizzle',
|
|
284
|
+
'victoria-sponge'
|
|
285
|
+
\]}
|
|
286
|
+
name\="let-them-eat-cake"
|
|
287
|
+
\>
|
|
288
|
+
<IressCheckbox value\="lemon-drizzle"\>
|
|
289
|
+
Lemon drizzle </IressCheckbox\>
|
|
290
|
+
<IressCheckbox value\="victoria-sponge"\>
|
|
291
|
+
Victoria Sponge </IressCheckbox\>
|
|
292
|
+
<IressCheckbox value\="carrot-cake"\>
|
|
293
|
+
Carrot Cake </IressCheckbox\>
|
|
294
|
+
</IressCheckboxGroup\>
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Props
|
|
299
|
+
|
|
300
|
+
| Name | Description | Default | Control |
|
|
301
|
+
| --- | --- | --- | --- |
|
|
302
|
+
| children |
|
|
303
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
304
|
+
|
|
305
|
+
ReactNode
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
| \- | \- |
|
|
310
|
+
| defaultValue |
|
|
311
|
+
|
|
312
|
+
Value of checkbox group when in uncontrolled mode.
|
|
313
|
+
|
|
314
|
+
union
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
| \- |
|
|
319
|
+
|
|
320
|
+
RAW
|
|
321
|
+
|
|
322
|
+
* defaultValue :
|
|
323
|
+
|
|
324
|
+
\[
|
|
325
|
+
|
|
326
|
+
* 0 : "lemon-drizzle"
|
|
327
|
+
* 1 : "victoria-sponge"
|
|
328
|
+
|
|
329
|
+
\]
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
|
335
|
+
| hiddenCheckbox |
|
|
336
|
+
|
|
337
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
338
|
+
|
|
339
|
+
boolean
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
| \- | Set boolean |
|
|
344
|
+
| layout |
|
|
345
|
+
|
|
346
|
+
Sets which of the block / inline layout options apply.
|
|
347
|
+
|
|
348
|
+
union
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
|
353
|
+
|
|
354
|
+
'stack'
|
|
355
|
+
|
|
356
|
+
|
|
|
357
|
+
|
|
358
|
+
stackblockinline
|
|
359
|
+
|
|
360
|
+
|
|
|
361
|
+
| name |
|
|
362
|
+
|
|
363
|
+
Name to be applied to all checkboxes in the group.
|
|
364
|
+
|
|
365
|
+
string
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
| \- | let-them-eat-cake |
|
|
370
|
+
| onChange |
|
|
371
|
+
|
|
372
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
373
|
+
|
|
374
|
+
(value?: T\[\]) => void
|
|
375
|
+
|
|
376
|
+
| \- | \- |
|
|
377
|
+
| readOnly |
|
|
378
|
+
|
|
379
|
+
Renders the group in a read-only state.
|
|
380
|
+
|
|
381
|
+
boolean
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
| \- | Set boolean |
|
|
386
|
+
| role |
|
|
387
|
+
|
|
388
|
+
|
|
|
389
|
+
|
|
390
|
+
'group'
|
|
391
|
+
|
|
392
|
+
| Set object |
|
|
393
|
+
| touch |
|
|
394
|
+
|
|
395
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
396
|
+
|
|
397
|
+
boolean
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
| \- | Set boolean |
|
|
402
|
+
| value |
|
|
403
|
+
|
|
404
|
+
Value of checkbox group when in controlled mode.
|
|
405
|
+
|
|
406
|
+
union
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
| \- | Set object |
|
|
411
|
+
|
|
412
|
+
### Changing the checked state
|
|
413
|
+
|
|
414
|
+
The `value` prop can be updated if you need to change the checked state without interacting with the checkboxes.
|
|
415
|
+
|
|
416
|
+
For example, if you want to clear down the selected options:
|
|
417
|
+
|
|
418
|
+
[](./iframe.html?id=components-checkboxgroup--controlled)
|
|
419
|
+
|
|
420
|
+
Lemon drizzle
|
|
421
|
+
|
|
422
|
+
Victoria Sponge
|
|
423
|
+
|
|
424
|
+
Carrot Cake
|
|
425
|
+
|
|
426
|
+
Clear
|
|
427
|
+
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
import {
|
|
431
|
+
type FormControlValue,
|
|
432
|
+
IressButton,
|
|
433
|
+
IressCheckbox,
|
|
434
|
+
IressCheckboxGroup,
|
|
435
|
+
type IressCheckboxGroupProps,
|
|
436
|
+
IressStack,
|
|
437
|
+
} from '@iress-oss/ids-components';
|
|
438
|
+
import { useState } from 'react';
|
|
439
|
+
export const CheckboxGroupUsingState \= <T \= FormControlValue,\>(
|
|
440
|
+
<T\>,
|
|
441
|
+
) => {
|
|
442
|
+
const \[value, setValue\] \= useState<T\[\]\>(\[\]);
|
|
443
|
+
return (
|
|
444
|
+
<IressStack gap\="sm"\>
|
|
445
|
+
<IressCheckboxGroup
|
|
446
|
+
{...{
|
|
447
|
+
name: 'let-them-eat-cake',
|
|
448
|
+
}}
|
|
449
|
+
value\={value}
|
|
450
|
+
onChange\={(newValue) \=> setValue(newValue ?? \[\])}
|
|
451
|
+
\>
|
|
452
|
+
<IressCheckbox value\="lemon-drizzle"\>Lemon drizzle</IressCheckbox\>
|
|
453
|
+
<IressCheckbox value\="victoria-sponge"\>Victoria Sponge</IressCheckbox\>
|
|
454
|
+
<IressCheckbox value\="carrot-cake"\>Carrot Cake</IressCheckbox\>
|
|
455
|
+
</IressCheckboxGroup\>
|
|
456
|
+
<IressButton onClick\={() \=> setValue(\[\])}\>Clear</IressButton\>
|
|
457
|
+
</IressStack\>
|
|
458
|
+
);
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
#### Props
|
|
464
|
+
|
|
465
|
+
| Name | Description | Default | Control |
|
|
466
|
+
| --- | --- | --- | --- |
|
|
467
|
+
| children |
|
|
468
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
469
|
+
|
|
470
|
+
ReactNode
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
| \- | \- |
|
|
475
|
+
| defaultValue |
|
|
476
|
+
|
|
477
|
+
Value of checkbox group when in uncontrolled mode.
|
|
478
|
+
|
|
479
|
+
union
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
| \- | Set object |
|
|
484
|
+
| hiddenCheckbox |
|
|
485
|
+
|
|
486
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
487
|
+
|
|
488
|
+
boolean
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
| \- | Set boolean |
|
|
493
|
+
| layout |
|
|
494
|
+
|
|
495
|
+
Sets which of the block / inline layout options apply.
|
|
496
|
+
|
|
497
|
+
union
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
|
502
|
+
|
|
503
|
+
'stack'
|
|
504
|
+
|
|
505
|
+
|
|
|
506
|
+
|
|
507
|
+
stackblockinline
|
|
508
|
+
|
|
509
|
+
|
|
|
510
|
+
| name |
|
|
511
|
+
|
|
512
|
+
Name to be applied to all checkboxes in the group.
|
|
513
|
+
|
|
514
|
+
string
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
| \- | let-them-eat-cake |
|
|
519
|
+
| onChange |
|
|
520
|
+
|
|
521
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
522
|
+
|
|
523
|
+
(value?: T\[\]) => void
|
|
524
|
+
|
|
525
|
+
| \- | \- |
|
|
526
|
+
| readOnly |
|
|
527
|
+
|
|
528
|
+
Renders the group in a read-only state.
|
|
529
|
+
|
|
530
|
+
boolean
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
| \- | Set boolean |
|
|
535
|
+
| role |
|
|
536
|
+
|
|
537
|
+
|
|
|
538
|
+
|
|
539
|
+
'group'
|
|
540
|
+
|
|
541
|
+
| Set object |
|
|
542
|
+
| touch |
|
|
543
|
+
|
|
544
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
545
|
+
|
|
546
|
+
boolean
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
| \- | Set boolean |
|
|
551
|
+
| value |
|
|
552
|
+
|
|
553
|
+
Value of checkbox group when in controlled mode.
|
|
554
|
+
|
|
555
|
+
union
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
| \- | \- |
|
|
560
|
+
|
|
561
|
+
### Layout
|
|
562
|
+
|
|
563
|
+
The `layout` prop controls how the checkbox group is displayed and can have three basic layouts:
|
|
564
|
+
|
|
565
|
+
* **Stack (Default):** Checkboxes are laid out vertically. Labels are only as wide as their text.
|
|
566
|
+
* **Block:** Same as Stack, but labels take up the full width of the container.
|
|
567
|
+
* **Inline:** Checkboxes are laid out horizontally. Labels are only as wide as their text.
|
|
568
|
+
|
|
569
|
+
[](./iframe.html?id=components-checkboxgroup--layout)
|
|
570
|
+
|
|
571
|
+
### block
|
|
572
|
+
|
|
573
|
+
Google
|
|
574
|
+
|
|
575
|
+
Newspaper
|
|
576
|
+
|
|
577
|
+
Friend
|
|
578
|
+
|
|
579
|
+
Other
|
|
580
|
+
|
|
581
|
+
### inline
|
|
582
|
+
|
|
583
|
+
Google
|
|
584
|
+
|
|
585
|
+
Newspaper
|
|
586
|
+
|
|
587
|
+
Friend
|
|
588
|
+
|
|
589
|
+
Other
|
|
590
|
+
|
|
591
|
+
### stack
|
|
592
|
+
|
|
593
|
+
Google
|
|
594
|
+
|
|
595
|
+
Newspaper
|
|
596
|
+
|
|
597
|
+
Friend
|
|
598
|
+
|
|
599
|
+
Other
|
|
600
|
+
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
<IressText\>
|
|
604
|
+
<h3\>
|
|
605
|
+
block </h3\>
|
|
606
|
+
<IressCheckboxGroup layout\="block"\>
|
|
607
|
+
<IressCheckbox
|
|
608
|
+
layerStyle\="elevation.raised"
|
|
609
|
+
value\="google"
|
|
610
|
+
\>
|
|
611
|
+
Google </IressCheckbox\>
|
|
612
|
+
<IressCheckbox
|
|
613
|
+
layerStyle\="elevation.raised"
|
|
614
|
+
value\="newspaper"
|
|
615
|
+
\>
|
|
616
|
+
Newspaper </IressCheckbox\>
|
|
617
|
+
<IressCheckbox
|
|
618
|
+
layerStyle\="elevation.raised"
|
|
619
|
+
value\="friend"
|
|
620
|
+
\>
|
|
621
|
+
Friend </IressCheckbox\>
|
|
622
|
+
<IressCheckbox
|
|
623
|
+
layerStyle\="elevation.raised"
|
|
624
|
+
value\="other"
|
|
625
|
+
\>
|
|
626
|
+
Other </IressCheckbox\>
|
|
627
|
+
</IressCheckboxGroup\>
|
|
628
|
+
<h3\>
|
|
629
|
+
inline </h3\>
|
|
630
|
+
<IressCheckboxGroup layout\="inline"\>
|
|
631
|
+
<IressCheckbox
|
|
632
|
+
layerStyle\="elevation.raised"
|
|
633
|
+
value\="google"
|
|
634
|
+
\>
|
|
635
|
+
Google </IressCheckbox\>
|
|
636
|
+
<IressCheckbox
|
|
637
|
+
layerStyle\="elevation.raised"
|
|
638
|
+
value\="newspaper"
|
|
639
|
+
\>
|
|
640
|
+
Newspaper </IressCheckbox\>
|
|
641
|
+
<IressCheckbox
|
|
642
|
+
layerStyle\="elevation.raised"
|
|
643
|
+
value\="friend"
|
|
644
|
+
\>
|
|
645
|
+
Friend </IressCheckbox\>
|
|
646
|
+
<IressCheckbox
|
|
647
|
+
layerStyle\="elevation.raised"
|
|
648
|
+
value\="other"
|
|
649
|
+
\>
|
|
650
|
+
Other </IressCheckbox\>
|
|
651
|
+
</IressCheckboxGroup\>
|
|
652
|
+
<h3\>
|
|
653
|
+
stack </h3\>
|
|
654
|
+
<IressCheckboxGroup layout\="stack"\>
|
|
655
|
+
<IressCheckbox
|
|
656
|
+
layerStyle\="elevation.raised"
|
|
657
|
+
value\="google"
|
|
658
|
+
\>
|
|
659
|
+
Google </IressCheckbox\>
|
|
660
|
+
<IressCheckbox
|
|
661
|
+
layerStyle\="elevation.raised"
|
|
662
|
+
value\="newspaper"
|
|
663
|
+
\>
|
|
664
|
+
Newspaper </IressCheckbox\>
|
|
665
|
+
<IressCheckbox
|
|
666
|
+
layerStyle\="elevation.raised"
|
|
667
|
+
value\="friend"
|
|
668
|
+
\>
|
|
669
|
+
Friend </IressCheckbox\>
|
|
670
|
+
<IressCheckbox
|
|
671
|
+
layerStyle\="elevation.raised"
|
|
672
|
+
value\="other"
|
|
673
|
+
\>
|
|
674
|
+
Other </IressCheckbox\>
|
|
675
|
+
</IressCheckboxGroup\>
|
|
676
|
+
</IressText\>
|
|
677
|
+
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
#### Props
|
|
681
|
+
|
|
682
|
+
| Name | Description | Default | Control |
|
|
683
|
+
| --- | --- | --- | --- |
|
|
684
|
+
| children |
|
|
685
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
686
|
+
|
|
687
|
+
ReactNode
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
| \- | \- |
|
|
692
|
+
| defaultValue |
|
|
693
|
+
|
|
694
|
+
Value of checkbox group when in uncontrolled mode.
|
|
695
|
+
|
|
696
|
+
union
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
| \- | Set object |
|
|
701
|
+
| hiddenCheckbox |
|
|
702
|
+
|
|
703
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
704
|
+
|
|
705
|
+
boolean
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
| \- | Set boolean |
|
|
710
|
+
| layout |
|
|
711
|
+
|
|
712
|
+
Sets which of the block / inline layout options apply.
|
|
713
|
+
|
|
714
|
+
union
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
|
719
|
+
|
|
720
|
+
'stack'
|
|
721
|
+
|
|
722
|
+
| \- |
|
|
723
|
+
| name |
|
|
724
|
+
|
|
725
|
+
Name to be applied to all checkboxes in the group.
|
|
726
|
+
|
|
727
|
+
string
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
| \- | Set string |
|
|
732
|
+
| onChange |
|
|
733
|
+
|
|
734
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
735
|
+
|
|
736
|
+
(value?: T\[\]) => void
|
|
737
|
+
|
|
738
|
+
| \- | \- |
|
|
739
|
+
| readOnly |
|
|
740
|
+
|
|
741
|
+
Renders the group in a read-only state.
|
|
742
|
+
|
|
743
|
+
boolean
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
| \- | Set boolean |
|
|
748
|
+
| role |
|
|
749
|
+
|
|
750
|
+
|
|
|
751
|
+
|
|
752
|
+
'group'
|
|
753
|
+
|
|
754
|
+
| Set object |
|
|
755
|
+
| touch |
|
|
756
|
+
|
|
757
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
758
|
+
|
|
759
|
+
boolean
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
| \- | Set boolean |
|
|
764
|
+
| value |
|
|
765
|
+
|
|
766
|
+
Value of checkbox group when in controlled mode.
|
|
767
|
+
|
|
768
|
+
union
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
| \- | Set object |
|
|
773
|
+
|
|
774
|
+
### Hidden checkboxes
|
|
775
|
+
|
|
776
|
+
You can use the `hiddenCheckbox` prop to create custom checkboxes. When enabled, the actual checkbox will be visually hidden, allowing you to create more interesting controls. The checked state will be shown by the label's border, which is thicker when the checkbox is checked.
|
|
777
|
+
|
|
778
|
+
When `hiddenCheckbox` is enabled, the label will have no padding. Padding can be added by using an `IressPanel`.
|
|
779
|
+
|
|
780
|
+
[](./iframe.html?id=components-checkboxgroup--hidden-checkboxes)
|
|
781
|
+
|
|
782
|
+
**I'd like to discuss the following with my financial adviser:**
|
|
783
|
+
|
|
784
|
+
Select all that apply
|
|
785
|
+
|
|
786
|
+
Buying my first home
|
|
787
|
+
|
|
788
|
+
Saving for a holiday
|
|
789
|
+
|
|
790
|
+
Reducing my debt
|
|
791
|
+
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
<IressField
|
|
795
|
+
hint\="Select all that apply"
|
|
796
|
+
label\="I'd like to discuss the following with my financial adviser:"
|
|
797
|
+
\>
|
|
798
|
+
<IressCheckboxGroup
|
|
799
|
+
defaultValue\={\[
|
|
800
|
+
'home'
|
|
801
|
+
\]}
|
|
802
|
+
hiddenCheckbox
|
|
803
|
+
layout\="inline"
|
|
804
|
+
name\="financial-review"
|
|
805
|
+
\>
|
|
806
|
+
<IressCheckbox value\="home"\>
|
|
807
|
+
<IressPanel
|
|
808
|
+
bg\="transparent"
|
|
809
|
+
p\="lg"
|
|
810
|
+
textAlign\="center"
|
|
811
|
+
\>
|
|
812
|
+
<IressStack gap\="md"\>
|
|
813
|
+
<IressIcon
|
|
814
|
+
name\="house"
|
|
815
|
+
textStyle\="typography.heading.1"
|
|
816
|
+
/>
|
|
817
|
+
<IressText
|
|
818
|
+
noGutter
|
|
819
|
+
textStyle\="typography.heading.4"
|
|
820
|
+
\>
|
|
821
|
+
Buying my first home </IressText\>
|
|
822
|
+
</IressStack\>
|
|
823
|
+
</IressPanel\>
|
|
824
|
+
</IressCheckbox\>
|
|
825
|
+
<IressCheckbox value\="holiday"\>
|
|
826
|
+
<IressPanel
|
|
827
|
+
bg\="transparent"
|
|
828
|
+
p\="lg"
|
|
829
|
+
textAlign\="center"
|
|
830
|
+
\>
|
|
831
|
+
<IressStack gap\="md"\>
|
|
832
|
+
<IressIcon
|
|
833
|
+
name\="mountain"
|
|
834
|
+
textStyle\="typography.heading.1"
|
|
835
|
+
/>
|
|
836
|
+
<IressText
|
|
837
|
+
noGutter
|
|
838
|
+
textStyle\="typography.heading.4"
|
|
839
|
+
\>
|
|
840
|
+
Saving for a holiday </IressText\>
|
|
841
|
+
</IressStack\>
|
|
842
|
+
</IressPanel\>
|
|
843
|
+
</IressCheckbox\>
|
|
844
|
+
<IressCheckbox value\="debt"\>
|
|
845
|
+
<IressPanel
|
|
846
|
+
bg\="transparent"
|
|
847
|
+
p\="lg"
|
|
848
|
+
textAlign\="center"
|
|
849
|
+
\>
|
|
850
|
+
<IressStack gap\="md"\>
|
|
851
|
+
<IressIcon
|
|
852
|
+
name\="credit-card"
|
|
853
|
+
textStyle\="typography.heading.1"
|
|
854
|
+
/>
|
|
855
|
+
<IressText
|
|
856
|
+
noGutter
|
|
857
|
+
textStyle\="typography.heading.4"
|
|
858
|
+
\>
|
|
859
|
+
Reducing my debt </IressText\>
|
|
860
|
+
</IressStack\>
|
|
861
|
+
</IressPanel\>
|
|
862
|
+
</IressCheckbox\>
|
|
863
|
+
</IressCheckboxGroup\>
|
|
864
|
+
</IressField\>
|
|
865
|
+
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
#### Props
|
|
869
|
+
|
|
870
|
+
| Name | Description | Default | Control |
|
|
871
|
+
| --- | --- | --- | --- |
|
|
872
|
+
| children |
|
|
873
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
874
|
+
|
|
875
|
+
ReactNode
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
| \- | \- |
|
|
880
|
+
| defaultValue |
|
|
881
|
+
|
|
882
|
+
Value of checkbox group when in uncontrolled mode.
|
|
883
|
+
|
|
884
|
+
union
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
| \- |
|
|
889
|
+
|
|
890
|
+
RAW
|
|
891
|
+
|
|
892
|
+
* defaultValue :
|
|
893
|
+
|
|
894
|
+
\[
|
|
895
|
+
|
|
896
|
+
* 0 : "home"
|
|
897
|
+
|
|
898
|
+
\]
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
|
904
|
+
| hiddenCheckbox |
|
|
905
|
+
|
|
906
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
907
|
+
|
|
908
|
+
boolean
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
| \- | FalseTrue |
|
|
913
|
+
| layout |
|
|
914
|
+
|
|
915
|
+
Sets which of the block / inline layout options apply.
|
|
916
|
+
|
|
917
|
+
union
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
|
922
|
+
|
|
923
|
+
'stack'
|
|
924
|
+
|
|
925
|
+
|
|
|
926
|
+
|
|
927
|
+
stackblockinline
|
|
928
|
+
|
|
929
|
+
|
|
|
930
|
+
| name |
|
|
931
|
+
|
|
932
|
+
Name to be applied to all checkboxes in the group.
|
|
933
|
+
|
|
934
|
+
string
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
| \- | financial-review |
|
|
939
|
+
| onChange |
|
|
940
|
+
|
|
941
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
942
|
+
|
|
943
|
+
(value?: T\[\]) => void
|
|
944
|
+
|
|
945
|
+
| \- | \- |
|
|
946
|
+
| readOnly |
|
|
947
|
+
|
|
948
|
+
Renders the group in a read-only state.
|
|
949
|
+
|
|
950
|
+
boolean
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
| \- | Set boolean |
|
|
955
|
+
| role |
|
|
956
|
+
|
|
957
|
+
|
|
|
958
|
+
|
|
959
|
+
'group'
|
|
960
|
+
|
|
961
|
+
| Set object |
|
|
962
|
+
| touch |
|
|
963
|
+
|
|
964
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
965
|
+
|
|
966
|
+
boolean
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
| \- | Set boolean |
|
|
971
|
+
| value |
|
|
972
|
+
|
|
973
|
+
Value of checkbox group when in controlled mode.
|
|
974
|
+
|
|
975
|
+
union
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
| \- | Set object |
|
|
980
|
+
|
|
981
|
+
### Laying out custom checkboxes
|
|
982
|
+
|
|
983
|
+
The checkbox group's `layout` prop gives you some default options to help control the layout of your controls. But sometimes you need more granular control, which you can achieve with a bit of custom CSS.
|
|
984
|
+
|
|
985
|
+
The example below uses CSS grid to give us evenly spaced / sized checkboxes, which will wrap on to new lines as the screen size reduces. The grid wrapper element is a div that wraps around the `<IressCheckbox>` elements, as shown by the dashed border. Use the grab handle in the bottom right-hand corner of the grid wrapper to see how the controls change size to respond to the container's width.
|
|
986
|
+
|
|
987
|
+
[](./iframe.html?id=components-checkboxgroup--custom-checkbox-group-layout)
|
|
988
|
+
|
|
989
|
+
**I'd like to discuss the following with my financial adviser:**
|
|
990
|
+
|
|
991
|
+
Select all that apply
|
|
992
|
+
|
|
993
|
+
Retirement
|
|
994
|
+
|
|
995
|
+
Buying my first home
|
|
996
|
+
|
|
997
|
+
Saving for a holiday
|
|
998
|
+
|
|
999
|
+
Saving for my child's education
|
|
1000
|
+
|
|
1001
|
+
Saving for emergency
|
|
1002
|
+
|
|
1003
|
+
Spending more time on my hobbies
|
|
1004
|
+
|
|
1005
|
+
Reducing my debt
|
|
1006
|
+
|
|
1007
|
+
Starting a business
|
|
1008
|
+
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
<IressField
|
|
1012
|
+
hint\="Select all that apply"
|
|
1013
|
+
label\="I'd like to discuss the following with my financial adviser:"
|
|
1014
|
+
\>
|
|
1015
|
+
<IressCheckboxGroup
|
|
1016
|
+
defaultValue\={\[
|
|
1017
|
+
'home'
|
|
1018
|
+
\]}
|
|
1019
|
+
hiddenCheckbox
|
|
1020
|
+
layout\="block"
|
|
1021
|
+
name\="financial-review"
|
|
1022
|
+
\>
|
|
1023
|
+
<div
|
|
1024
|
+
style\={{
|
|
1025
|
+
border: '1px dashed hsl(43deg 100% 45%)',
|
|
1026
|
+
display: 'grid',
|
|
1027
|
+
gridAutoRows: '1fr',
|
|
1028
|
+
gridGap: '16px',
|
|
1029
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
|
|
1030
|
+
overflow: 'auto',
|
|
1031
|
+
padding: '0.5rem',
|
|
1032
|
+
resize: 'horizontal',
|
|
1033
|
+
width: '100%'
|
|
1034
|
+
}}
|
|
1035
|
+
\>
|
|
1036
|
+
<IressCheckbox value\="retirement"\>
|
|
1037
|
+
<IressPanel
|
|
1038
|
+
bg\="transparent"
|
|
1039
|
+
p\="lg"
|
|
1040
|
+
textAlign\="center"
|
|
1041
|
+
\>
|
|
1042
|
+
<IressStack gap\="md"\>
|
|
1043
|
+
<IressIcon
|
|
1044
|
+
name\="tree-palm"
|
|
1045
|
+
textStyle\="typography.heading.1"
|
|
1046
|
+
/>
|
|
1047
|
+
<IressText
|
|
1048
|
+
noGutter
|
|
1049
|
+
textStyle\="typography.heading.4"
|
|
1050
|
+
\>
|
|
1051
|
+
Retirement </IressText\>
|
|
1052
|
+
</IressStack\>
|
|
1053
|
+
</IressPanel\>
|
|
1054
|
+
</IressCheckbox\>
|
|
1055
|
+
<IressCheckbox value\="home"\>
|
|
1056
|
+
<IressPanel
|
|
1057
|
+
bg\="transparent"
|
|
1058
|
+
p\="lg"
|
|
1059
|
+
textAlign\="center"
|
|
1060
|
+
\>
|
|
1061
|
+
<IressStack gap\="md"\>
|
|
1062
|
+
<IressIcon
|
|
1063
|
+
name\="house"
|
|
1064
|
+
textStyle\="typography.heading.1"
|
|
1065
|
+
/>
|
|
1066
|
+
<IressText
|
|
1067
|
+
noGutter
|
|
1068
|
+
textStyle\="typography.heading.4"
|
|
1069
|
+
\>
|
|
1070
|
+
Buying my first home </IressText\>
|
|
1071
|
+
</IressStack\>
|
|
1072
|
+
</IressPanel\>
|
|
1073
|
+
</IressCheckbox\>
|
|
1074
|
+
<IressCheckbox value\="holiday"\>
|
|
1075
|
+
<IressPanel
|
|
1076
|
+
bg\="transparent"
|
|
1077
|
+
p\="lg"
|
|
1078
|
+
textAlign\="center"
|
|
1079
|
+
\>
|
|
1080
|
+
<IressStack gap\="md"\>
|
|
1081
|
+
<IressIcon
|
|
1082
|
+
name\="mountain"
|
|
1083
|
+
textStyle\="typography.heading.1"
|
|
1084
|
+
/>
|
|
1085
|
+
<IressText
|
|
1086
|
+
noGutter
|
|
1087
|
+
textStyle\="typography.heading.4"
|
|
1088
|
+
\>
|
|
1089
|
+
Saving for a holiday </IressText\>
|
|
1090
|
+
</IressStack\>
|
|
1091
|
+
</IressPanel\>
|
|
1092
|
+
</IressCheckbox\>
|
|
1093
|
+
<IressCheckbox value\="education"\>
|
|
1094
|
+
<IressPanel
|
|
1095
|
+
bg\="transparent"
|
|
1096
|
+
p\="lg"
|
|
1097
|
+
textAlign\="center"
|
|
1098
|
+
\>
|
|
1099
|
+
<IressStack gap\="md"\>
|
|
1100
|
+
<IressIcon
|
|
1101
|
+
name\="graduation-cap"
|
|
1102
|
+
textStyle\="typography.heading.1"
|
|
1103
|
+
/>
|
|
1104
|
+
<IressText
|
|
1105
|
+
noGutter
|
|
1106
|
+
textStyle\="typography.heading.4"
|
|
1107
|
+
\>
|
|
1108
|
+
Saving for my child's education </IressText\>
|
|
1109
|
+
</IressStack\>
|
|
1110
|
+
</IressPanel\>
|
|
1111
|
+
</IressCheckbox\>
|
|
1112
|
+
<IressCheckbox value\="emergency"\>
|
|
1113
|
+
<IressPanel
|
|
1114
|
+
bg\="transparent"
|
|
1115
|
+
p\="lg"
|
|
1116
|
+
textAlign\="center"
|
|
1117
|
+
\>
|
|
1118
|
+
<IressStack gap\="md"\>
|
|
1119
|
+
<IressIcon
|
|
1120
|
+
name\="medkit"
|
|
1121
|
+
textStyle\="typography.heading.1"
|
|
1122
|
+
/>
|
|
1123
|
+
<IressText
|
|
1124
|
+
noGutter
|
|
1125
|
+
textStyle\="typography.heading.4"
|
|
1126
|
+
\>
|
|
1127
|
+
Saving for emergency </IressText\>
|
|
1128
|
+
</IressStack\>
|
|
1129
|
+
</IressPanel\>
|
|
1130
|
+
</IressCheckbox\>
|
|
1131
|
+
<IressCheckbox value\="hobby"\>
|
|
1132
|
+
<IressPanel
|
|
1133
|
+
bg\="transparent"
|
|
1134
|
+
p\="lg"
|
|
1135
|
+
textAlign\="center"
|
|
1136
|
+
\>
|
|
1137
|
+
<IressStack gap\="md"\>
|
|
1138
|
+
<IressIcon
|
|
1139
|
+
name\="bicycle"
|
|
1140
|
+
textStyle\="typography.heading.1"
|
|
1141
|
+
/>
|
|
1142
|
+
<IressText
|
|
1143
|
+
noGutter
|
|
1144
|
+
textStyle\="typography.heading.4"
|
|
1145
|
+
\>
|
|
1146
|
+
Spending more time on my hobbies </IressText\>
|
|
1147
|
+
</IressStack\>
|
|
1148
|
+
</IressPanel\>
|
|
1149
|
+
</IressCheckbox\>
|
|
1150
|
+
<IressCheckbox value\="debt"\>
|
|
1151
|
+
<IressPanel
|
|
1152
|
+
bg\="transparent"
|
|
1153
|
+
p\="lg"
|
|
1154
|
+
textAlign\="center"
|
|
1155
|
+
\>
|
|
1156
|
+
<IressStack gap\="md"\>
|
|
1157
|
+
<IressIcon
|
|
1158
|
+
name\="chart-line-down"
|
|
1159
|
+
textStyle\="typography.heading.1"
|
|
1160
|
+
/>
|
|
1161
|
+
<IressText
|
|
1162
|
+
noGutter
|
|
1163
|
+
textStyle\="typography.heading.4"
|
|
1164
|
+
\>
|
|
1165
|
+
Reducing my debt </IressText\>
|
|
1166
|
+
</IressStack\>
|
|
1167
|
+
</IressPanel\>
|
|
1168
|
+
</IressCheckbox\>
|
|
1169
|
+
<IressCheckbox value\="business"\>
|
|
1170
|
+
<IressPanel
|
|
1171
|
+
bg\="transparent"
|
|
1172
|
+
p\="lg"
|
|
1173
|
+
textAlign\="center"
|
|
1174
|
+
\>
|
|
1175
|
+
<IressStack gap\="md"\>
|
|
1176
|
+
<IressIcon
|
|
1177
|
+
name\="user-tie"
|
|
1178
|
+
textStyle\="typography.heading.1"
|
|
1179
|
+
/>
|
|
1180
|
+
<IressText
|
|
1181
|
+
noGutter
|
|
1182
|
+
textStyle\="typography.heading.4"
|
|
1183
|
+
\>
|
|
1184
|
+
Starting a business </IressText\>
|
|
1185
|
+
</IressStack\>
|
|
1186
|
+
</IressPanel\>
|
|
1187
|
+
</IressCheckbox\>
|
|
1188
|
+
</div\>
|
|
1189
|
+
</IressCheckboxGroup\>
|
|
1190
|
+
</IressField\>
|
|
1191
|
+
|
|
1192
|
+
```
|
|
1193
|
+
|
|
1194
|
+
#### Props
|
|
1195
|
+
|
|
1196
|
+
| Name | Description | Default | Control |
|
|
1197
|
+
| --- | --- | --- | --- |
|
|
1198
|
+
| children |
|
|
1199
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
1200
|
+
|
|
1201
|
+
ReactNode
|
|
1202
|
+
|
|
1203
|
+
|
|
1204
|
+
|
|
1205
|
+
| \- | \- |
|
|
1206
|
+
| defaultValue |
|
|
1207
|
+
|
|
1208
|
+
Value of checkbox group when in uncontrolled mode.
|
|
1209
|
+
|
|
1210
|
+
union
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
| \- |
|
|
1215
|
+
|
|
1216
|
+
RAW
|
|
1217
|
+
|
|
1218
|
+
* defaultValue :
|
|
1219
|
+
|
|
1220
|
+
\[
|
|
1221
|
+
|
|
1222
|
+
* 0 : "home"
|
|
1223
|
+
|
|
1224
|
+
\]
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+
|
|
|
1230
|
+
| hiddenCheckbox |
|
|
1231
|
+
|
|
1232
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
1233
|
+
|
|
1234
|
+
boolean
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
| \- | FalseTrue |
|
|
1239
|
+
| layout |
|
|
1240
|
+
|
|
1241
|
+
Sets which of the block / inline layout options apply.
|
|
1242
|
+
|
|
1243
|
+
union
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
|
|
|
1248
|
+
|
|
1249
|
+
'stack'
|
|
1250
|
+
|
|
1251
|
+
|
|
|
1252
|
+
|
|
1253
|
+
stackblockinline
|
|
1254
|
+
|
|
1255
|
+
|
|
|
1256
|
+
| name |
|
|
1257
|
+
|
|
1258
|
+
Name to be applied to all checkboxes in the group.
|
|
1259
|
+
|
|
1260
|
+
string
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
| \- | financial-review |
|
|
1265
|
+
| onChange |
|
|
1266
|
+
|
|
1267
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
1268
|
+
|
|
1269
|
+
(value?: T\[\]) => void
|
|
1270
|
+
|
|
1271
|
+
| \- | \- |
|
|
1272
|
+
| readOnly |
|
|
1273
|
+
|
|
1274
|
+
Renders the group in a read-only state.
|
|
1275
|
+
|
|
1276
|
+
boolean
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
| \- | Set boolean |
|
|
1281
|
+
| role |
|
|
1282
|
+
|
|
1283
|
+
|
|
|
1284
|
+
|
|
1285
|
+
'group'
|
|
1286
|
+
|
|
1287
|
+
| Set object |
|
|
1288
|
+
| touch |
|
|
1289
|
+
|
|
1290
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
1291
|
+
|
|
1292
|
+
boolean
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
| \- | Set boolean |
|
|
1297
|
+
| value |
|
|
1298
|
+
|
|
1299
|
+
Value of checkbox group when in controlled mode.
|
|
1300
|
+
|
|
1301
|
+
union
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
| \- | Set object |
|
|
1306
|
+
|
|
1307
|
+
### Read only
|
|
1308
|
+
|
|
1309
|
+
The `readOnly` prop changes how the checkbox group is rendered. It will only render the children that are checked (alongside a hidden input that contains the `value` if it was set), otherwise it not be rendered.
|
|
1310
|
+
|
|
1311
|
+
It is understandable that this may not be the desired behavior for all use cases. If you need a checkbox group that is not editable, but still visible, simply do not set the `readOnly` prop and set the `value` prop instead.
|
|
1312
|
+
|
|
1313
|
+
[](./iframe.html?id=components-checkboxgroup--read-only)
|
|
1314
|
+
|
|
1315
|
+
Lemon drizzle
|
|
1316
|
+
|
|
1317
|
+
Victoria Sponge
|
|
1318
|
+
|
|
1319
|
+
```
|
|
1320
|
+
|
|
1321
|
+
<IressCheckboxGroup
|
|
1322
|
+
defaultValue\={\[
|
|
1323
|
+
'lemon-drizzle',
|
|
1324
|
+
'victoria-sponge'
|
|
1325
|
+
\]}
|
|
1326
|
+
name\="let-them-eat-cake"
|
|
1327
|
+
readOnly
|
|
1328
|
+
\>
|
|
1329
|
+
<IressCheckbox value\="lemon-drizzle"\>
|
|
1330
|
+
Lemon drizzle </IressCheckbox\>
|
|
1331
|
+
<IressCheckbox value\="victoria-sponge"\>
|
|
1332
|
+
Victoria Sponge </IressCheckbox\>
|
|
1333
|
+
<IressCheckbox value\="carrot-cake"\>
|
|
1334
|
+
Carrot Cake </IressCheckbox\>
|
|
1335
|
+
</IressCheckboxGroup\>
|
|
1336
|
+
|
|
1337
|
+
```
|
|
1338
|
+
|
|
1339
|
+
#### Props
|
|
1340
|
+
|
|
1341
|
+
| Name | Description | Default | Control |
|
|
1342
|
+
| --- | --- | --- | --- |
|
|
1343
|
+
| children |
|
|
1344
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
1345
|
+
|
|
1346
|
+
ReactNode
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
| \- | \- |
|
|
1351
|
+
| defaultValue |
|
|
1352
|
+
|
|
1353
|
+
Value of checkbox group when in uncontrolled mode.
|
|
1354
|
+
|
|
1355
|
+
union
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
| \- |
|
|
1360
|
+
|
|
1361
|
+
RAW
|
|
1362
|
+
|
|
1363
|
+
* defaultValue :
|
|
1364
|
+
|
|
1365
|
+
\[
|
|
1366
|
+
|
|
1367
|
+
* 0 : "lemon-drizzle"
|
|
1368
|
+
* 1 : "victoria-sponge"
|
|
1369
|
+
|
|
1370
|
+
\]
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
|
|
|
1376
|
+
| hiddenCheckbox |
|
|
1377
|
+
|
|
1378
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
1379
|
+
|
|
1380
|
+
boolean
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
| \- | Set boolean |
|
|
1385
|
+
| layout |
|
|
1386
|
+
|
|
1387
|
+
Sets which of the block / inline layout options apply.
|
|
1388
|
+
|
|
1389
|
+
union
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
|
|
1393
|
+
|
|
|
1394
|
+
|
|
1395
|
+
'stack'
|
|
1396
|
+
|
|
1397
|
+
|
|
|
1398
|
+
|
|
1399
|
+
stackblockinline
|
|
1400
|
+
|
|
1401
|
+
|
|
|
1402
|
+
| name |
|
|
1403
|
+
|
|
1404
|
+
Name to be applied to all checkboxes in the group.
|
|
1405
|
+
|
|
1406
|
+
string
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
| \- | let-them-eat-cake |
|
|
1411
|
+
| onChange |
|
|
1412
|
+
|
|
1413
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
1414
|
+
|
|
1415
|
+
(value?: T\[\]) => void
|
|
1416
|
+
|
|
1417
|
+
| \- | \- |
|
|
1418
|
+
| readOnly |
|
|
1419
|
+
|
|
1420
|
+
Renders the group in a read-only state.
|
|
1421
|
+
|
|
1422
|
+
boolean
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
| \- | FalseTrue |
|
|
1427
|
+
| role |
|
|
1428
|
+
|
|
1429
|
+
|
|
|
1430
|
+
|
|
1431
|
+
'group'
|
|
1432
|
+
|
|
1433
|
+
| Set object |
|
|
1434
|
+
| touch |
|
|
1435
|
+
|
|
1436
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
1437
|
+
|
|
1438
|
+
boolean
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
|
|
1442
|
+
| \- | Set boolean |
|
|
1443
|
+
| value |
|
|
1444
|
+
|
|
1445
|
+
Value of checkbox group when in controlled mode.
|
|
1446
|
+
|
|
1447
|
+
union
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
| \- | Set object |
|
|
1452
|
+
|
|
1453
|
+
### Touch
|
|
1454
|
+
|
|
1455
|
+
The `touch` prop adds the button-like border and padding to checkbox.
|
|
1456
|
+
|
|
1457
|
+
[](./iframe.html?id=components-checkboxgroup--touch)
|
|
1458
|
+
|
|
1459
|
+
Lemon drizzle
|
|
1460
|
+
|
|
1461
|
+
Victoria Sponge
|
|
1462
|
+
|
|
1463
|
+
Carrot Cake
|
|
1464
|
+
|
|
1465
|
+
```
|
|
1466
|
+
|
|
1467
|
+
<IressCheckboxGroup
|
|
1468
|
+
defaultValue\={\[
|
|
1469
|
+
'lemon-drizzle',
|
|
1470
|
+
'victoria-sponge'
|
|
1471
|
+
\]}
|
|
1472
|
+
name\="let-them-eat-cake"
|
|
1473
|
+
touch
|
|
1474
|
+
\>
|
|
1475
|
+
<IressCheckbox value\="lemon-drizzle"\>
|
|
1476
|
+
Lemon drizzle </IressCheckbox\>
|
|
1477
|
+
<IressCheckbox value\="victoria-sponge"\>
|
|
1478
|
+
Victoria Sponge </IressCheckbox\>
|
|
1479
|
+
<IressCheckbox value\="carrot-cake"\>
|
|
1480
|
+
Carrot Cake </IressCheckbox\>
|
|
1481
|
+
</IressCheckboxGroup\>
|
|
1482
|
+
|
|
1483
|
+
```
|
|
1484
|
+
|
|
1485
|
+
#### Props
|
|
1486
|
+
|
|
1487
|
+
| Name | Description | Default | Control |
|
|
1488
|
+
| --- | --- | --- | --- |
|
|
1489
|
+
| children |
|
|
1490
|
+
Content to be displayed inside the group, usually multiple `IressCheckbox`.
|
|
1491
|
+
|
|
1492
|
+
ReactNode
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
| \- | \- |
|
|
1497
|
+
| defaultValue |
|
|
1498
|
+
|
|
1499
|
+
Value of checkbox group when in uncontrolled mode.
|
|
1500
|
+
|
|
1501
|
+
union
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
| \- |
|
|
1506
|
+
|
|
1507
|
+
RAW
|
|
1508
|
+
|
|
1509
|
+
* defaultValue :
|
|
1510
|
+
|
|
1511
|
+
\[
|
|
1512
|
+
|
|
1513
|
+
* 0 : "lemon-drizzle"
|
|
1514
|
+
* 1 : "victoria-sponge"
|
|
1515
|
+
|
|
1516
|
+
\]
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
|
|
|
1522
|
+
| hiddenCheckbox |
|
|
1523
|
+
|
|
1524
|
+
Hides the checkbox controls to allow the creation of custom checkboxes.
|
|
1525
|
+
|
|
1526
|
+
boolean
|
|
1527
|
+
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
| \- | Set boolean |
|
|
1531
|
+
| layout |
|
|
1532
|
+
|
|
1533
|
+
Sets which of the block / inline layout options apply.
|
|
1534
|
+
|
|
1535
|
+
union
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
|
|
|
1540
|
+
|
|
1541
|
+
'stack'
|
|
1542
|
+
|
|
1543
|
+
|
|
|
1544
|
+
|
|
1545
|
+
stackblockinline
|
|
1546
|
+
|
|
1547
|
+
|
|
|
1548
|
+
| name |
|
|
1549
|
+
|
|
1550
|
+
Name to be applied to all checkboxes in the group.
|
|
1551
|
+
|
|
1552
|
+
string
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
| \- | let-them-eat-cake |
|
|
1557
|
+
| onChange |
|
|
1558
|
+
|
|
1559
|
+
Called with collated new value when a user toggles one of its children checkboxes.
|
|
1560
|
+
|
|
1561
|
+
(value?: T\[\]) => void
|
|
1562
|
+
|
|
1563
|
+
| \- | \- |
|
|
1564
|
+
| readOnly |
|
|
1565
|
+
|
|
1566
|
+
Renders the group in a read-only state.
|
|
1567
|
+
|
|
1568
|
+
boolean
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
| \- | Set boolean |
|
|
1573
|
+
| role |
|
|
1574
|
+
|
|
1575
|
+
|
|
|
1576
|
+
|
|
1577
|
+
'group'
|
|
1578
|
+
|
|
1579
|
+
| Set object |
|
|
1580
|
+
| touch |
|
|
1581
|
+
|
|
1582
|
+
Add the button-like border and padding to checkbox when `touch` is true.
|
|
1583
|
+
|
|
1584
|
+
boolean
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
| \- | FalseTrue |
|
|
1589
|
+
| value |
|
|
1590
|
+
|
|
1591
|
+
Value of checkbox group when in controlled mode.
|
|
1592
|
+
|
|
1593
|
+
union
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
| \- | Set object |
|