@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,980 @@
|
|
|
1
|
+
ButtonGroup
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
ButtonGroup allows users to switch between two or more possible states. ButtonGroups are only used for actions that occur immediately after the user “flips the switch”.
|
|
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-buttongroup--button-children)
|
|
18
|
+
|
|
19
|
+
Button group
|
|
20
|
+
|
|
21
|
+
Option 1Option 2Option 3Option 4
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
<IressButtonGroup label\="Button group"\>
|
|
26
|
+
<IressButton\>
|
|
27
|
+
Option 1 </IressButton\>
|
|
28
|
+
<IressButton\>
|
|
29
|
+
Option 2 </IressButton\>
|
|
30
|
+
<IressButton\>
|
|
31
|
+
Option 3 </IressButton\>
|
|
32
|
+
<IressButton\>
|
|
33
|
+
Option 4 </IressButton\>
|
|
34
|
+
</IressButtonGroup\>
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Props
|
|
39
|
+
-----
|
|
40
|
+
|
|
41
|
+
| Name | Description | Default | Control |
|
|
42
|
+
| --- | --- | --- | --- |
|
|
43
|
+
| children |
|
|
44
|
+
Content of the button group, usually multiple `IressButton`.
|
|
45
|
+
|
|
46
|
+
ReactNode
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
| \- | \- |
|
|
51
|
+
| defaultSelected |
|
|
52
|
+
|
|
53
|
+
Initially selected value, use for uncontrolled components.
|
|
54
|
+
|
|
55
|
+
unknown
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
| \- | Set object |
|
|
60
|
+
| hiddenLabel |
|
|
61
|
+
|
|
62
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
63
|
+
|
|
64
|
+
boolean
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
| \- | Set boolean |
|
|
69
|
+
| label\* |
|
|
70
|
+
|
|
71
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
72
|
+
|
|
73
|
+
ReactNode
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
| \- |
|
|
78
|
+
|
|
79
|
+
"Button group"
|
|
80
|
+
|
|
81
|
+
|
|
|
82
|
+
| multiple |
|
|
83
|
+
|
|
84
|
+
Allows multiple buttons to be selected.
|
|
85
|
+
|
|
86
|
+
TMultiple
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
| \- | Set object |
|
|
91
|
+
| onChange |
|
|
92
|
+
|
|
93
|
+
Called when a user activates one of its children buttons.
|
|
94
|
+
|
|
95
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
96
|
+
|
|
97
|
+
| \- | \- |
|
|
98
|
+
| selected |
|
|
99
|
+
|
|
100
|
+
Selected value, use for controlled components.
|
|
101
|
+
|
|
102
|
+
unknown
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
| \- | Set object |
|
|
107
|
+
|
|
108
|
+
Usage
|
|
109
|
+
-----
|
|
110
|
+
|
|
111
|
+
Button Group requires some `label` text to describe what the group of buttons represent. The `label` text can be visually hidden (but still read by screenreaders) using the `hiddenLabel` prop.
|
|
112
|
+
|
|
113
|
+
The `children` prop should contain multiple `IressButton` components.
|
|
114
|
+
|
|
115
|
+
You can use the `onChange` prop to watch when a button is clicked.
|
|
116
|
+
|
|
117
|
+
**Note:**
|
|
118
|
+
|
|
119
|
+
* The `options` props, originally used to map a set of strings to `IressButton`, has been deprecated. Instead, you can use array.map to map the options to `IressButton` in your own application.
|
|
120
|
+
* The `mode` prop on `IressButton` is not supported when used inside an `IressButtonGroup`.
|
|
121
|
+
|
|
122
|
+
[](./iframe.html?id=components-buttongroup--button-children)
|
|
123
|
+
|
|
124
|
+
Button group
|
|
125
|
+
|
|
126
|
+
Option 1Option 2Option 3Option 4
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
<IressButtonGroup label\="Button group"\>
|
|
131
|
+
<IressButton\>
|
|
132
|
+
Option 1 </IressButton\>
|
|
133
|
+
<IressButton\>
|
|
134
|
+
Option 2 </IressButton\>
|
|
135
|
+
<IressButton\>
|
|
136
|
+
Option 3 </IressButton\>
|
|
137
|
+
<IressButton\>
|
|
138
|
+
Option 4 </IressButton\>
|
|
139
|
+
</IressButtonGroup\>
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Props
|
|
144
|
+
|
|
145
|
+
| Name | Description | Default | Control |
|
|
146
|
+
| --- | --- | --- | --- |
|
|
147
|
+
| children |
|
|
148
|
+
Content of the button group, usually multiple `IressButton`.
|
|
149
|
+
|
|
150
|
+
ReactNode
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
| \- | \- |
|
|
155
|
+
| defaultSelected |
|
|
156
|
+
|
|
157
|
+
Initially selected value, use for uncontrolled components.
|
|
158
|
+
|
|
159
|
+
unknown
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
| \- | Set object |
|
|
164
|
+
| hiddenLabel |
|
|
165
|
+
|
|
166
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
167
|
+
|
|
168
|
+
boolean
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
| \- | Set boolean |
|
|
173
|
+
| label\* |
|
|
174
|
+
|
|
175
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
176
|
+
|
|
177
|
+
ReactNode
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
| \- |
|
|
182
|
+
|
|
183
|
+
"Button group"
|
|
184
|
+
|
|
185
|
+
|
|
|
186
|
+
| multiple |
|
|
187
|
+
|
|
188
|
+
Allows multiple buttons to be selected.
|
|
189
|
+
|
|
190
|
+
TMultiple
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
| \- | Set object |
|
|
195
|
+
| onChange |
|
|
196
|
+
|
|
197
|
+
Called when a user activates one of its children buttons.
|
|
198
|
+
|
|
199
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
200
|
+
|
|
201
|
+
| \- | \- |
|
|
202
|
+
| selected |
|
|
203
|
+
|
|
204
|
+
Selected value, use for controlled components.
|
|
205
|
+
|
|
206
|
+
unknown
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
| \- | Set object |
|
|
211
|
+
|
|
212
|
+
Examples
|
|
213
|
+
--------
|
|
214
|
+
|
|
215
|
+
### Rich buttons
|
|
216
|
+
|
|
217
|
+
By passing the buttons as children you have more control over the display of the button allowing you to use icons or tooltips.
|
|
218
|
+
|
|
219
|
+
**Note:** In this case, please set the `value` prop on the `IressButton` component to ensure the correct value is used when the button is clicked.
|
|
220
|
+
|
|
221
|
+
[](./iframe.html?id=components-buttongroup--rich-buttons)
|
|
222
|
+
|
|
223
|
+
Text alignment
|
|
224
|
+
|
|
225
|
+
Left
|
|
226
|
+
|
|
227
|
+
Center
|
|
228
|
+
|
|
229
|
+
Right
|
|
230
|
+
|
|
231
|
+
* * *
|
|
232
|
+
|
|
233
|
+
Justify
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
<IressButtonGroup label\="Text alignment"\>
|
|
238
|
+
<IressTooltip tooltipText\="Left"\>
|
|
239
|
+
<IressButton value\="left"\>
|
|
240
|
+
<IressIcon name\="align-left" />
|
|
241
|
+
<span className\="iress-sr-only"\>
|
|
242
|
+
Left </span\>
|
|
243
|
+
</IressButton\>
|
|
244
|
+
</IressTooltip\>
|
|
245
|
+
<IressTooltip tooltipText\="Center"\>
|
|
246
|
+
<IressButton value\="center"\>
|
|
247
|
+
<IressIcon name\="align-center" />
|
|
248
|
+
<span className\="iress-sr-only"\>
|
|
249
|
+
Center </span\>
|
|
250
|
+
</IressButton\>
|
|
251
|
+
</IressTooltip\>
|
|
252
|
+
<IressTooltip tooltipText\="Right"\>
|
|
253
|
+
<IressButton value\="right"\>
|
|
254
|
+
<IressIcon name\="align-right" />
|
|
255
|
+
<span className\="iress-sr-only"\>
|
|
256
|
+
Right </span\>
|
|
257
|
+
</IressButton\>
|
|
258
|
+
</IressTooltip\>
|
|
259
|
+
<IressDivider
|
|
260
|
+
mx\="xs"
|
|
261
|
+
vertical
|
|
262
|
+
/>
|
|
263
|
+
<IressTooltip tooltipText\="Justify"\>
|
|
264
|
+
<IressButton value\="justify"\>
|
|
265
|
+
<IressIcon name\="align-justify" />
|
|
266
|
+
<span className\="iress-sr-only"\>
|
|
267
|
+
Justify </span\>
|
|
268
|
+
</IressButton\>
|
|
269
|
+
</IressTooltip\>
|
|
270
|
+
</IressButtonGroup\>
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
#### Props
|
|
275
|
+
|
|
276
|
+
| Name | Description | Default | Control |
|
|
277
|
+
| --- | --- | --- | --- |
|
|
278
|
+
| children |
|
|
279
|
+
Content of the button group, usually multiple `IressButton`.
|
|
280
|
+
|
|
281
|
+
ReactNode
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
| \- | \- |
|
|
286
|
+
| defaultSelected |
|
|
287
|
+
|
|
288
|
+
Initially selected value, use for uncontrolled components.
|
|
289
|
+
|
|
290
|
+
unknown
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
| \- | Set object |
|
|
295
|
+
| hiddenLabel |
|
|
296
|
+
|
|
297
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
298
|
+
|
|
299
|
+
boolean
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
| \- | Set boolean |
|
|
304
|
+
| label\* |
|
|
305
|
+
|
|
306
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
307
|
+
|
|
308
|
+
ReactNode
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
| \- |
|
|
313
|
+
|
|
314
|
+
"Text alignment"
|
|
315
|
+
|
|
316
|
+
|
|
|
317
|
+
| multiple |
|
|
318
|
+
|
|
319
|
+
Allows multiple buttons to be selected.
|
|
320
|
+
|
|
321
|
+
TMultiple
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
| \- | Set object |
|
|
326
|
+
| onChange |
|
|
327
|
+
|
|
328
|
+
Called when a user activates one of its children buttons.
|
|
329
|
+
|
|
330
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
331
|
+
|
|
332
|
+
| \- | \- |
|
|
333
|
+
| selected |
|
|
334
|
+
|
|
335
|
+
Selected value, use for controlled components.
|
|
336
|
+
|
|
337
|
+
unknown
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
| \- | Set object |
|
|
342
|
+
|
|
343
|
+
### Multi-select
|
|
344
|
+
|
|
345
|
+
By default, only one button in the group can be selected at a time. By setting the `multiple` prop, multiple buttons can be selected.
|
|
346
|
+
|
|
347
|
+
[](./iframe.html?id=components-buttongroup--multi-select)
|
|
348
|
+
|
|
349
|
+
Multiple options can be selected
|
|
350
|
+
|
|
351
|
+
Option 1Option 2Option 3Option 4
|
|
352
|
+
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
<IressButtonGroup
|
|
356
|
+
label\="Multiple options can be selected"
|
|
357
|
+
multiple
|
|
358
|
+
\>
|
|
359
|
+
<IressButton\>
|
|
360
|
+
Option 1 </IressButton\>
|
|
361
|
+
<IressButton\>
|
|
362
|
+
Option 2 </IressButton\>
|
|
363
|
+
<IressButton\>
|
|
364
|
+
Option 3 </IressButton\>
|
|
365
|
+
<IressButton\>
|
|
366
|
+
Option 4 </IressButton\>
|
|
367
|
+
</IressButtonGroup\>
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
#### Props
|
|
372
|
+
|
|
373
|
+
| Name | Description | Default | Control |
|
|
374
|
+
| --- | --- | --- | --- |
|
|
375
|
+
| children |
|
|
376
|
+
Content of the button group, usually multiple `IressButton`.
|
|
377
|
+
|
|
378
|
+
ReactNode
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
| \- | \- |
|
|
383
|
+
| defaultSelected |
|
|
384
|
+
|
|
385
|
+
Initially selected value, use for uncontrolled components.
|
|
386
|
+
|
|
387
|
+
unknown
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
| \- | Set object |
|
|
392
|
+
| hiddenLabel |
|
|
393
|
+
|
|
394
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
395
|
+
|
|
396
|
+
boolean
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
| \- | Set boolean |
|
|
401
|
+
| label\* |
|
|
402
|
+
|
|
403
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
404
|
+
|
|
405
|
+
ReactNode
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
| \- |
|
|
410
|
+
|
|
411
|
+
"Multiple options can be selected"
|
|
412
|
+
|
|
413
|
+
|
|
|
414
|
+
| multiple |
|
|
415
|
+
|
|
416
|
+
Allows multiple buttons to be selected.
|
|
417
|
+
|
|
418
|
+
TMultiple
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
| \- |
|
|
423
|
+
|
|
424
|
+
true
|
|
425
|
+
|
|
426
|
+
|
|
|
427
|
+
| onChange |
|
|
428
|
+
|
|
429
|
+
Called when a user activates one of its children buttons.
|
|
430
|
+
|
|
431
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
432
|
+
|
|
433
|
+
| \- | \- |
|
|
434
|
+
| selected |
|
|
435
|
+
|
|
436
|
+
Selected value, use for controlled components.
|
|
437
|
+
|
|
438
|
+
unknown
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
| \- | Set object |
|
|
443
|
+
|
|
444
|
+
### Pre-selecting buttons
|
|
445
|
+
|
|
446
|
+
Buttons within the group can be pre-selected using the `defaultSelected` prop (for uncontrolled components), or the `selected` prop if you are planning to control the state yourself.
|
|
447
|
+
|
|
448
|
+
If the button group is in its default single select mode, these props expects a string that matches the text of one of the buttons, or the `value` prop of the button if it has been set.
|
|
449
|
+
|
|
450
|
+
In multi-select mode, these props expects an array of matching strings.
|
|
451
|
+
|
|
452
|
+
[](./iframe.html?id=components-buttongroup--selected-single)
|
|
453
|
+
|
|
454
|
+
Selected option for single select
|
|
455
|
+
|
|
456
|
+
Option 1Option 2Option 3Option 4
|
|
457
|
+
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
<IressButtonGroup
|
|
461
|
+
defaultSelected\="Option 2"
|
|
462
|
+
label\="Selected option for single select"
|
|
463
|
+
\>
|
|
464
|
+
<IressButton\>
|
|
465
|
+
Option 1 </IressButton\>
|
|
466
|
+
<IressButton\>
|
|
467
|
+
Option 2 </IressButton\>
|
|
468
|
+
<IressButton\>
|
|
469
|
+
Option 3 </IressButton\>
|
|
470
|
+
<IressButton\>
|
|
471
|
+
Option 4 </IressButton\>
|
|
472
|
+
</IressButtonGroup\>
|
|
473
|
+
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
#### Props
|
|
477
|
+
|
|
478
|
+
| Name | Description | Default | Control |
|
|
479
|
+
| --- | --- | --- | --- |
|
|
480
|
+
| children |
|
|
481
|
+
Content of the button group, usually multiple `IressButton`.
|
|
482
|
+
|
|
483
|
+
ReactNode
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
| \- | \- |
|
|
488
|
+
| defaultSelected |
|
|
489
|
+
|
|
490
|
+
Initially selected value, use for uncontrolled components.
|
|
491
|
+
|
|
492
|
+
unknown
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
| \- |
|
|
497
|
+
|
|
498
|
+
"Option 2"
|
|
499
|
+
|
|
500
|
+
|
|
|
501
|
+
| hiddenLabel |
|
|
502
|
+
|
|
503
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
504
|
+
|
|
505
|
+
boolean
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
| \- | Set boolean |
|
|
510
|
+
| label\* |
|
|
511
|
+
|
|
512
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
513
|
+
|
|
514
|
+
ReactNode
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
| \- |
|
|
519
|
+
|
|
520
|
+
"Selected option for single select"
|
|
521
|
+
|
|
522
|
+
|
|
|
523
|
+
| multiple |
|
|
524
|
+
|
|
525
|
+
Allows multiple buttons to be selected.
|
|
526
|
+
|
|
527
|
+
TMultiple
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
| \- | Set object |
|
|
532
|
+
| onChange |
|
|
533
|
+
|
|
534
|
+
Called when a user activates one of its children buttons.
|
|
535
|
+
|
|
536
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
537
|
+
|
|
538
|
+
| \- | \- |
|
|
539
|
+
| selected |
|
|
540
|
+
|
|
541
|
+
Selected value, use for controlled components.
|
|
542
|
+
|
|
543
|
+
unknown
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
| \- | Set object |
|
|
548
|
+
|
|
549
|
+
[](./iframe.html?id=components-buttongroup--selected-multiple)
|
|
550
|
+
|
|
551
|
+
Selected option for multi-select
|
|
552
|
+
|
|
553
|
+
Option 1Option 2Option 3Option 4
|
|
554
|
+
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
<IressButtonGroup
|
|
558
|
+
defaultSelected\={\[
|
|
559
|
+
'Option 2',
|
|
560
|
+
'Option 4'
|
|
561
|
+
\]}
|
|
562
|
+
label\="Selected option for multi-select"
|
|
563
|
+
multiple
|
|
564
|
+
\>
|
|
565
|
+
<IressButton\>
|
|
566
|
+
Option 1 </IressButton\>
|
|
567
|
+
<IressButton\>
|
|
568
|
+
Option 2 </IressButton\>
|
|
569
|
+
<IressButton\>
|
|
570
|
+
Option 3 </IressButton\>
|
|
571
|
+
<IressButton\>
|
|
572
|
+
Option 4 </IressButton\>
|
|
573
|
+
</IressButtonGroup\>
|
|
574
|
+
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
#### Props
|
|
578
|
+
|
|
579
|
+
| Name | Description | Default | Control |
|
|
580
|
+
| --- | --- | --- | --- |
|
|
581
|
+
| children |
|
|
582
|
+
Content of the button group, usually multiple `IressButton`.
|
|
583
|
+
|
|
584
|
+
ReactNode
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
| \- | \- |
|
|
589
|
+
| defaultSelected |
|
|
590
|
+
|
|
591
|
+
Initially selected value, use for uncontrolled components.
|
|
592
|
+
|
|
593
|
+
unknown
|
|
594
|
+
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
| \- |
|
|
598
|
+
|
|
599
|
+
RAW
|
|
600
|
+
|
|
601
|
+
* defaultSelected :
|
|
602
|
+
|
|
603
|
+
\[
|
|
604
|
+
|
|
605
|
+
* 0 : "Option 2"
|
|
606
|
+
* 1 : "Option 4"
|
|
607
|
+
|
|
608
|
+
\]
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
|
614
|
+
| hiddenLabel |
|
|
615
|
+
|
|
616
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
617
|
+
|
|
618
|
+
boolean
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
| \- | Set boolean |
|
|
623
|
+
| label\* |
|
|
624
|
+
|
|
625
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
626
|
+
|
|
627
|
+
ReactNode
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
| \- |
|
|
632
|
+
|
|
633
|
+
"Selected option for multi-select"
|
|
634
|
+
|
|
635
|
+
|
|
|
636
|
+
| multiple |
|
|
637
|
+
|
|
638
|
+
Allows multiple buttons to be selected.
|
|
639
|
+
|
|
640
|
+
TMultiple
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
| \- |
|
|
645
|
+
|
|
646
|
+
true
|
|
647
|
+
|
|
648
|
+
|
|
|
649
|
+
| onChange |
|
|
650
|
+
|
|
651
|
+
Called when a user activates one of its children buttons.
|
|
652
|
+
|
|
653
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
654
|
+
|
|
655
|
+
| \- | \- |
|
|
656
|
+
| selected |
|
|
657
|
+
|
|
658
|
+
Selected value, use for controlled components.
|
|
659
|
+
|
|
660
|
+
unknown
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
| \- | Set object |
|
|
665
|
+
|
|
666
|
+
### `onChange` event
|
|
667
|
+
|
|
668
|
+
The Button Group emits an event when any of the selected buttons change. The event detail (`ButtonGroupChange`) consist of a string or an array of strings (depending on if it's in single or multi select mode) that represents the selected button(s).
|
|
669
|
+
|
|
670
|
+
[](./iframe.html?id=components-buttongroup--on-change)
|
|
671
|
+
|
|
672
|
+
Trigger toasts by selecting an option below
|
|
673
|
+
|
|
674
|
+
Option 1Option 2Option 3Option 4
|
|
675
|
+
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
{
|
|
679
|
+
args: {
|
|
680
|
+
...ButtonChildren.args,
|
|
681
|
+
label: 'Trigger toasts by selecting an option below'
|
|
682
|
+
},
|
|
683
|
+
render: args \=> {
|
|
684
|
+
const {
|
|
685
|
+
success
|
|
686
|
+
} \= useToaster();
|
|
687
|
+
return <IressButtonGroup {...args} onChange\={selected \=> {
|
|
688
|
+
success({
|
|
689
|
+
content: \`Selected: ${selected ? String(selected) : 'none'}\`
|
|
690
|
+
});
|
|
691
|
+
}} /\>;
|
|
692
|
+
},
|
|
693
|
+
decorators: \[Story \=> <IressToasterProvider\>
|
|
694
|
+
<Story />
|
|
695
|
+
</IressToasterProvider\>\]
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
#### Props
|
|
701
|
+
|
|
702
|
+
| Name | Description | Default | Control |
|
|
703
|
+
| --- | --- | --- | --- |
|
|
704
|
+
| children |
|
|
705
|
+
Content of the button group, usually multiple `IressButton`.
|
|
706
|
+
|
|
707
|
+
ReactNode
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
| \- | \- |
|
|
712
|
+
| defaultSelected |
|
|
713
|
+
|
|
714
|
+
Initially selected value, use for uncontrolled components.
|
|
715
|
+
|
|
716
|
+
unknown
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
| \- | Set object |
|
|
721
|
+
| hiddenLabel |
|
|
722
|
+
|
|
723
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
724
|
+
|
|
725
|
+
boolean
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
| \- | Set boolean |
|
|
730
|
+
| label\* |
|
|
731
|
+
|
|
732
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
733
|
+
|
|
734
|
+
ReactNode
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
| \- |
|
|
739
|
+
|
|
740
|
+
"Trigger toasts by selecting an option below"
|
|
741
|
+
|
|
742
|
+
|
|
|
743
|
+
| multiple |
|
|
744
|
+
|
|
745
|
+
Allows multiple buttons to be selected.
|
|
746
|
+
|
|
747
|
+
TMultiple
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
| \- | Set object |
|
|
752
|
+
| onChange |
|
|
753
|
+
|
|
754
|
+
Called when a user activates one of its children buttons.
|
|
755
|
+
|
|
756
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
757
|
+
|
|
758
|
+
| \- | \- |
|
|
759
|
+
| selected |
|
|
760
|
+
|
|
761
|
+
Selected value, use for controlled components.
|
|
762
|
+
|
|
763
|
+
unknown
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
| \- | Set object |
|
|
768
|
+
|
|
769
|
+
### Hidden label
|
|
770
|
+
|
|
771
|
+
If you would like to visually hide the label, you can use the `hiddenLabel` prop.
|
|
772
|
+
|
|
773
|
+
[](./iframe.html?id=components-buttongroup--hidden-label)
|
|
774
|
+
|
|
775
|
+
Button group
|
|
776
|
+
|
|
777
|
+
Option 1Option 2Option 3Option 4
|
|
778
|
+
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
<IressButtonGroup
|
|
782
|
+
hiddenLabel
|
|
783
|
+
label\="Button group"
|
|
784
|
+
\>
|
|
785
|
+
<IressButton\>
|
|
786
|
+
Option 1 </IressButton\>
|
|
787
|
+
<IressButton\>
|
|
788
|
+
Option 2 </IressButton\>
|
|
789
|
+
<IressButton\>
|
|
790
|
+
Option 3 </IressButton\>
|
|
791
|
+
<IressButton\>
|
|
792
|
+
Option 4 </IressButton\>
|
|
793
|
+
</IressButtonGroup\>
|
|
794
|
+
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
#### Props
|
|
798
|
+
|
|
799
|
+
| Name | Description | Default | Control |
|
|
800
|
+
| --- | --- | --- | --- |
|
|
801
|
+
| children |
|
|
802
|
+
Content of the button group, usually multiple `IressButton`.
|
|
803
|
+
|
|
804
|
+
ReactNode
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
| \- | \- |
|
|
809
|
+
| defaultSelected |
|
|
810
|
+
|
|
811
|
+
Initially selected value, use for uncontrolled components.
|
|
812
|
+
|
|
813
|
+
unknown
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
| \- | Set object |
|
|
818
|
+
| hiddenLabel |
|
|
819
|
+
|
|
820
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
821
|
+
|
|
822
|
+
boolean
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
| \- | FalseTrue |
|
|
827
|
+
| label\* |
|
|
828
|
+
|
|
829
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
830
|
+
|
|
831
|
+
ReactNode
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
| \- |
|
|
836
|
+
|
|
837
|
+
"Button group"
|
|
838
|
+
|
|
839
|
+
|
|
|
840
|
+
| multiple |
|
|
841
|
+
|
|
842
|
+
Allows multiple buttons to be selected.
|
|
843
|
+
|
|
844
|
+
TMultiple
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
| \- | Set object |
|
|
849
|
+
| onChange |
|
|
850
|
+
|
|
851
|
+
Called when a user activates one of its children buttons.
|
|
852
|
+
|
|
853
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
854
|
+
|
|
855
|
+
| \- | \- |
|
|
856
|
+
| selected |
|
|
857
|
+
|
|
858
|
+
Selected value, use for controlled components.
|
|
859
|
+
|
|
860
|
+
unknown
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
| \- | Set object |
|
|
865
|
+
|
|
866
|
+
### Headings as labels
|
|
867
|
+
|
|
868
|
+
For semantic reasons, you may need the label to be rendered as a heading. In this case, you can pass the element directly to the `label` prop. The component will automatically add the `id` required to connect the button group to its label.
|
|
869
|
+
|
|
870
|
+
[](./iframe.html?id=components-buttongroup--heading-label)
|
|
871
|
+
|
|
872
|
+
Heading as label
|
|
873
|
+
----------------
|
|
874
|
+
|
|
875
|
+
Option 1Option 2Option 3Option 4
|
|
876
|
+
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
{
|
|
880
|
+
args: {
|
|
881
|
+
...ButtonChildren.args,
|
|
882
|
+
label: <IressText element\="h2"\>Heading as label</IressText\>
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
#### Props
|
|
889
|
+
|
|
890
|
+
| Name | Description | Default | Control |
|
|
891
|
+
| --- | --- | --- | --- |
|
|
892
|
+
| children |
|
|
893
|
+
Content of the button group, usually multiple `IressButton`.
|
|
894
|
+
|
|
895
|
+
ReactNode
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
| \- | \- |
|
|
900
|
+
| defaultSelected |
|
|
901
|
+
|
|
902
|
+
Initially selected value, use for uncontrolled components.
|
|
903
|
+
|
|
904
|
+
unknown
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
| \- | Set object |
|
|
909
|
+
| hiddenLabel |
|
|
910
|
+
|
|
911
|
+
Hides the label if set; label will still be read out by screen readers.
|
|
912
|
+
|
|
913
|
+
boolean
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
| \- | Set boolean |
|
|
918
|
+
| label\* |
|
|
919
|
+
|
|
920
|
+
Sets the label text for the button group. If passed an element, it will render the element with an id, to ensure its connection to the button group.
|
|
921
|
+
|
|
922
|
+
ReactNode
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
| \- |
|
|
927
|
+
|
|
928
|
+
RAW
|
|
929
|
+
|
|
930
|
+
label :
|
|
931
|
+
|
|
932
|
+
{
|
|
933
|
+
|
|
934
|
+
* $$typeof : Symbol(react.transitional.element)
|
|
935
|
+
* type : ({ className, ...restProps }) => { \_s(); const Component = useMemo( () => styled(restProps.element ?? "div", text), \[restProps.element\] ); return /\* @\_\_PURE\_\_ \*/ jsxDEV( Component, { ...restProps, className: cx(className, GlobalCSSClass.Text) }, void 0, false, { fileName: "/home/runner/work/design-system/design-system/packages/components/src/components/Text/Text.tsx", lineNumber: 46, columnNumber: 5 }, this ); }
|
|
936
|
+
* key : null
|
|
937
|
+
* props :
|
|
938
|
+
|
|
939
|
+
{...} 2 keys
|
|
940
|
+
|
|
941
|
+
* \_owner : null
|
|
942
|
+
* \_store :
|
|
943
|
+
|
|
944
|
+
{...} 0 keys
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
|
|
|
956
|
+
| multiple |
|
|
957
|
+
|
|
958
|
+
Allows multiple buttons to be selected.
|
|
959
|
+
|
|
960
|
+
TMultiple
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
| \- | Set object |
|
|
965
|
+
| onChange |
|
|
966
|
+
|
|
967
|
+
Called when a user activates one of its children buttons.
|
|
968
|
+
|
|
969
|
+
(newValue?: ControlledValue<T, TMultiple>) => void
|
|
970
|
+
|
|
971
|
+
| \- | \- |
|
|
972
|
+
| selected |
|
|
973
|
+
|
|
974
|
+
Selected value, use for controlled components.
|
|
975
|
+
|
|
976
|
+
unknown
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
| \- | Set object |
|