@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,955 @@
|
|
|
1
|
+
Tab Set
|
|
2
|
+
=======
|
|
3
|
+
|
|
4
|
+
Overview
|
|
5
|
+
--------
|
|
6
|
+
|
|
7
|
+
Tabs are used to display modular pieces of related data that do not need to be compared or accessed simultaneously.
|
|
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-tabset--panels)
|
|
18
|
+
|
|
19
|
+
Address
|
|
20
|
+
|
|
21
|
+
Employment
|
|
22
|
+
|
|
23
|
+
History
|
|
24
|
+
|
|
25
|
+
Address information goes here
|
|
26
|
+
|
|
27
|
+
Employment information goes here
|
|
28
|
+
|
|
29
|
+
Medical history goes here
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
<IressTabSet\>
|
|
34
|
+
<IressTab label\="Address"\>
|
|
35
|
+
Address information goes here </IressTab\>
|
|
36
|
+
<IressTab label\="Employment"\>
|
|
37
|
+
Employment information goes here </IressTab\>
|
|
38
|
+
<IressTab label\="History"\>
|
|
39
|
+
Medical history goes here </IressTab\>
|
|
40
|
+
</IressTabSet\>
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Props
|
|
45
|
+
-----
|
|
46
|
+
|
|
47
|
+
| Name | Description | Default | Control |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| children |
|
|
50
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
51
|
+
|
|
52
|
+
ReactNode
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
| \- | \- |
|
|
57
|
+
| defaultSelected |
|
|
58
|
+
|
|
59
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
60
|
+
|
|
61
|
+
FormControlValue
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
| \- | Set object |
|
|
66
|
+
| layout |
|
|
67
|
+
|
|
68
|
+
Layout options for the positioning of tabs.
|
|
69
|
+
|
|
70
|
+
union
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
|
75
|
+
|
|
76
|
+
'top-left'
|
|
77
|
+
|
|
78
|
+
|
|
|
79
|
+
|
|
80
|
+
top-lefttop-centertop-right
|
|
81
|
+
|
|
82
|
+
|
|
|
83
|
+
| onChange |
|
|
84
|
+
|
|
85
|
+
Emitted when a tab changes.
|
|
86
|
+
|
|
87
|
+
(event: TabSetChangedEventDetail) => void
|
|
88
|
+
|
|
89
|
+
| \- | \- |
|
|
90
|
+
| panelStyle |
|
|
91
|
+
|
|
92
|
+
Custom style for the panel (the area that contains the tab content).
|
|
93
|
+
|
|
94
|
+
IressCustomiseSlot
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
| \- | Set object |
|
|
99
|
+
| selected |
|
|
100
|
+
|
|
101
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
102
|
+
|
|
103
|
+
FormControlValue
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
| \- | Set object |
|
|
108
|
+
| tabHolderStyle |
|
|
109
|
+
|
|
110
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
111
|
+
|
|
112
|
+
IressCustomiseSlot
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
| \- | Set object |
|
|
117
|
+
|
|
118
|
+
Usage
|
|
119
|
+
-----
|
|
120
|
+
|
|
121
|
+
The `IressTabSet` is a wrapper for `IressTab` components to make a up a set of tabs.
|
|
122
|
+
|
|
123
|
+
### Navigation
|
|
124
|
+
|
|
125
|
+
You can use the `IressTabSet` component to create tab navigation to control an area of the page, or even navigate between different pages.
|
|
126
|
+
|
|
127
|
+
[](./iframe.html?id=components-tabset--tab-navigation)
|
|
128
|
+
|
|
129
|
+
[Iress](https://iress.com)
|
|
130
|
+
|
|
131
|
+
[Google](https://google.com)
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
<IressTabSet\>
|
|
136
|
+
<IressTab
|
|
137
|
+
href\="https://iress.com"
|
|
138
|
+
label\="Iress"
|
|
139
|
+
/>
|
|
140
|
+
<IressTab
|
|
141
|
+
href\="https://google.com"
|
|
142
|
+
label\="Google"
|
|
143
|
+
/>
|
|
144
|
+
</IressTabSet\>
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### Props
|
|
149
|
+
|
|
150
|
+
| Name | Description | Default | Control |
|
|
151
|
+
| --- | --- | --- | --- |
|
|
152
|
+
| children |
|
|
153
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
154
|
+
|
|
155
|
+
ReactNode
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
| \- | \- |
|
|
160
|
+
| defaultSelected |
|
|
161
|
+
|
|
162
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
163
|
+
|
|
164
|
+
FormControlValue
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
| \- | Set object |
|
|
169
|
+
| layout |
|
|
170
|
+
|
|
171
|
+
Layout options for the positioning of tabs.
|
|
172
|
+
|
|
173
|
+
union
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
|
178
|
+
|
|
179
|
+
'top-left'
|
|
180
|
+
|
|
181
|
+
|
|
|
182
|
+
|
|
183
|
+
top-lefttop-centertop-right
|
|
184
|
+
|
|
185
|
+
|
|
|
186
|
+
| onChange |
|
|
187
|
+
|
|
188
|
+
Emitted when a tab changes.
|
|
189
|
+
|
|
190
|
+
(event: TabSetChangedEventDetail) => void
|
|
191
|
+
|
|
192
|
+
| \- | \- |
|
|
193
|
+
| panelStyle |
|
|
194
|
+
|
|
195
|
+
Custom style for the panel (the area that contains the tab content).
|
|
196
|
+
|
|
197
|
+
IressCustomiseSlot
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
| \- | Set object |
|
|
202
|
+
| selected |
|
|
203
|
+
|
|
204
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
205
|
+
|
|
206
|
+
FormControlValue
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
| \- | Set object |
|
|
211
|
+
| tabHolderStyle |
|
|
212
|
+
|
|
213
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
214
|
+
|
|
215
|
+
IressCustomiseSlot
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
| \- | Set object |
|
|
220
|
+
|
|
221
|
+
### With `children` prop
|
|
222
|
+
|
|
223
|
+
Using the `children` prop will automatically inject the content as a tab panel when active, along with appropriate attributes for accessibility, ensuring the tab and its associated panel can be navigated by screenreaders.
|
|
224
|
+
|
|
225
|
+
[](./iframe.html?id=components-tabset--panels)
|
|
226
|
+
|
|
227
|
+
Address
|
|
228
|
+
|
|
229
|
+
Employment
|
|
230
|
+
|
|
231
|
+
History
|
|
232
|
+
|
|
233
|
+
Address information goes here
|
|
234
|
+
|
|
235
|
+
Employment information goes here
|
|
236
|
+
|
|
237
|
+
Medical history goes here
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
<IressTabSet\>
|
|
242
|
+
<IressTab label\="Address"\>
|
|
243
|
+
Address information goes here </IressTab\>
|
|
244
|
+
<IressTab label\="Employment"\>
|
|
245
|
+
Employment information goes here </IressTab\>
|
|
246
|
+
<IressTab label\="History"\>
|
|
247
|
+
Medical history goes here </IressTab\>
|
|
248
|
+
</IressTabSet\>
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### Props
|
|
253
|
+
|
|
254
|
+
| Name | Description | Default | Control |
|
|
255
|
+
| --- | --- | --- | --- |
|
|
256
|
+
| children |
|
|
257
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
258
|
+
|
|
259
|
+
ReactNode
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
| \- | \- |
|
|
264
|
+
| defaultSelected |
|
|
265
|
+
|
|
266
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
267
|
+
|
|
268
|
+
FormControlValue
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
| \- | Set object |
|
|
273
|
+
| layout |
|
|
274
|
+
|
|
275
|
+
Layout options for the positioning of tabs.
|
|
276
|
+
|
|
277
|
+
union
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
|
282
|
+
|
|
283
|
+
'top-left'
|
|
284
|
+
|
|
285
|
+
|
|
|
286
|
+
|
|
287
|
+
top-lefttop-centertop-right
|
|
288
|
+
|
|
289
|
+
|
|
|
290
|
+
| onChange |
|
|
291
|
+
|
|
292
|
+
Emitted when a tab changes.
|
|
293
|
+
|
|
294
|
+
(event: TabSetChangedEventDetail) => void
|
|
295
|
+
|
|
296
|
+
| \- | \- |
|
|
297
|
+
| panelStyle |
|
|
298
|
+
|
|
299
|
+
Custom style for the panel (the area that contains the tab content).
|
|
300
|
+
|
|
301
|
+
IressCustomiseSlot
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
| \- | Set object |
|
|
306
|
+
| selected |
|
|
307
|
+
|
|
308
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
309
|
+
|
|
310
|
+
FormControlValue
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
| \- | Set object |
|
|
315
|
+
| tabHolderStyle |
|
|
316
|
+
|
|
317
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
318
|
+
|
|
319
|
+
IressCustomiseSlot
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
| \- | Set object |
|
|
324
|
+
|
|
325
|
+
Examples
|
|
326
|
+
--------
|
|
327
|
+
|
|
328
|
+
### Default selected
|
|
329
|
+
|
|
330
|
+
If you would like to set a tab by default, use the `defaultSelected` prop.
|
|
331
|
+
|
|
332
|
+
[](./iframe.html?id=components-tabset--default-selected)
|
|
333
|
+
|
|
334
|
+
[Iress](https://iress.com)
|
|
335
|
+
|
|
336
|
+
[Google](https://google.com)
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
<IressTabSet defaultSelected\={1}\>
|
|
341
|
+
<IressTab
|
|
342
|
+
href\="https://iress.com"
|
|
343
|
+
label\="Iress"
|
|
344
|
+
/>
|
|
345
|
+
<IressTab
|
|
346
|
+
href\="https://google.com"
|
|
347
|
+
label\="Google"
|
|
348
|
+
/>
|
|
349
|
+
</IressTabSet\>
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
#### Props
|
|
354
|
+
|
|
355
|
+
| Name | Description | Default | Control |
|
|
356
|
+
| --- | --- | --- | --- |
|
|
357
|
+
| children |
|
|
358
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
359
|
+
|
|
360
|
+
ReactNode
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
| \- | \- |
|
|
365
|
+
| defaultSelected |
|
|
366
|
+
|
|
367
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
368
|
+
|
|
369
|
+
FormControlValue
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
| \- |
|
|
374
|
+
|
|
375
|
+
1
|
|
376
|
+
|
|
377
|
+
|
|
|
378
|
+
| layout |
|
|
379
|
+
|
|
380
|
+
Layout options for the positioning of tabs.
|
|
381
|
+
|
|
382
|
+
union
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
|
387
|
+
|
|
388
|
+
'top-left'
|
|
389
|
+
|
|
390
|
+
|
|
|
391
|
+
|
|
392
|
+
top-lefttop-centertop-right
|
|
393
|
+
|
|
394
|
+
|
|
|
395
|
+
| onChange |
|
|
396
|
+
|
|
397
|
+
Emitted when a tab changes.
|
|
398
|
+
|
|
399
|
+
(event: TabSetChangedEventDetail) => void
|
|
400
|
+
|
|
401
|
+
| \- | \- |
|
|
402
|
+
| panelStyle |
|
|
403
|
+
|
|
404
|
+
Custom style for the panel (the area that contains the tab content).
|
|
405
|
+
|
|
406
|
+
IressCustomiseSlot
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
| \- | Set object |
|
|
411
|
+
| selected |
|
|
412
|
+
|
|
413
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
414
|
+
|
|
415
|
+
FormControlValue
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
| \- | Set object |
|
|
420
|
+
| tabHolderStyle |
|
|
421
|
+
|
|
422
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
423
|
+
|
|
424
|
+
IressCustomiseSlot
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
| \- | Set object |
|
|
429
|
+
|
|
430
|
+
### Controlled
|
|
431
|
+
|
|
432
|
+
You can use state to control the active tab by setting the `selected` property to which tab you would like to select. This should be the `value` of the tab you would like to select, or if you do not use the `value` prop, it's index.
|
|
433
|
+
|
|
434
|
+
[](./iframe.html?id=components-tabset--controlled)
|
|
435
|
+
|
|
436
|
+
Change to last tab
|
|
437
|
+
|
|
438
|
+
Address
|
|
439
|
+
|
|
440
|
+
Employment
|
|
441
|
+
|
|
442
|
+
History
|
|
443
|
+
|
|
444
|
+
Address information goes here
|
|
445
|
+
|
|
446
|
+
Employment information goes here
|
|
447
|
+
|
|
448
|
+
Medical history goes here
|
|
449
|
+
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
import {
|
|
453
|
+
IressButton,
|
|
454
|
+
IressStack,
|
|
455
|
+
IressTab,
|
|
456
|
+
IressTabSet,
|
|
457
|
+
type IressTabSetProps,
|
|
458
|
+
} from '@iress-oss/ids-components';
|
|
459
|
+
import { useState } from 'react';
|
|
460
|
+
export const TabsUsingState \= () \=> {
|
|
461
|
+
const \[selected, setSelected\] \= useState<number\>();
|
|
462
|
+
return (
|
|
463
|
+
<IressStack gap\="md"\>
|
|
464
|
+
<IressButton onClick\={() \=> setSelected(selected \=== 2 ? 0 : 2)}\>
|
|
465
|
+
{selected \=== 2 ? \`Back to first tab\` : \`Change to last tab\`}
|
|
466
|
+
</IressButton\>
|
|
467
|
+
<IressTabSet
|
|
468
|
+
|
|
469
|
+
selected\={selected}
|
|
470
|
+
onChange\={({ index }) \=> setSelected(index)}
|
|
471
|
+
\>
|
|
472
|
+
<IressTab label\="Address"\>Address information goes here</IressTab\>
|
|
473
|
+
<IressTab label\="Employment"\>Employment information goes here</IressTab\>
|
|
474
|
+
<IressTab label\="History"\>Medical history goes here</IressTab\>
|
|
475
|
+
</IressTabSet\>
|
|
476
|
+
</IressStack\>
|
|
477
|
+
);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
#### Props
|
|
483
|
+
|
|
484
|
+
| Name | Description | Default | Control |
|
|
485
|
+
| --- | --- | --- | --- |
|
|
486
|
+
| children |
|
|
487
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
488
|
+
|
|
489
|
+
ReactNode
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
| \- | \- |
|
|
494
|
+
| defaultSelected |
|
|
495
|
+
|
|
496
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
497
|
+
|
|
498
|
+
FormControlValue
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
| \- | Set object |
|
|
503
|
+
| layout |
|
|
504
|
+
|
|
505
|
+
Layout options for the positioning of tabs.
|
|
506
|
+
|
|
507
|
+
union
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
|
512
|
+
|
|
513
|
+
'top-left'
|
|
514
|
+
|
|
515
|
+
|
|
|
516
|
+
|
|
517
|
+
top-lefttop-centertop-right
|
|
518
|
+
|
|
519
|
+
|
|
|
520
|
+
| onChange |
|
|
521
|
+
|
|
522
|
+
Emitted when a tab changes.
|
|
523
|
+
|
|
524
|
+
(event: TabSetChangedEventDetail) => void
|
|
525
|
+
|
|
526
|
+
| \- | \- |
|
|
527
|
+
| panelStyle |
|
|
528
|
+
|
|
529
|
+
Custom style for the panel (the area that contains the tab content).
|
|
530
|
+
|
|
531
|
+
IressCustomiseSlot
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
| \- | Set object |
|
|
536
|
+
| selected |
|
|
537
|
+
|
|
538
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
539
|
+
|
|
540
|
+
FormControlValue
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
| \- | \- |
|
|
545
|
+
| tabHolderStyle |
|
|
546
|
+
|
|
547
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
548
|
+
|
|
549
|
+
IressCustomiseSlot
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
| \- | Set object |
|
|
554
|
+
|
|
555
|
+
### Layout
|
|
556
|
+
|
|
557
|
+
`IressTabSet` controls the layout of the tab buttons. These will always appear at the top of the tab container, and can be aligned to the left (default), centrally or to the right via the `layout` prop.
|
|
558
|
+
|
|
559
|
+
[](./iframe.html?id=components-tabset--layout)
|
|
560
|
+
|
|
561
|
+
top-left
|
|
562
|
+
--------
|
|
563
|
+
|
|
564
|
+
Address
|
|
565
|
+
|
|
566
|
+
Employment
|
|
567
|
+
|
|
568
|
+
History
|
|
569
|
+
|
|
570
|
+
Address information goes here
|
|
571
|
+
|
|
572
|
+
Employment information goes here
|
|
573
|
+
|
|
574
|
+
Medical history goes here
|
|
575
|
+
|
|
576
|
+
top-center
|
|
577
|
+
----------
|
|
578
|
+
|
|
579
|
+
Address
|
|
580
|
+
|
|
581
|
+
Employment
|
|
582
|
+
|
|
583
|
+
History
|
|
584
|
+
|
|
585
|
+
Address information goes here
|
|
586
|
+
|
|
587
|
+
Employment information goes here
|
|
588
|
+
|
|
589
|
+
Medical history goes here
|
|
590
|
+
|
|
591
|
+
top-right
|
|
592
|
+
---------
|
|
593
|
+
|
|
594
|
+
Address
|
|
595
|
+
|
|
596
|
+
Employment
|
|
597
|
+
|
|
598
|
+
History
|
|
599
|
+
|
|
600
|
+
Address information goes here
|
|
601
|
+
|
|
602
|
+
Employment information goes here
|
|
603
|
+
|
|
604
|
+
Medical history goes here
|
|
605
|
+
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
<IressStack gap\="md"\>
|
|
609
|
+
<IressPanel\>
|
|
610
|
+
<IressText element\="h2"\>
|
|
611
|
+
top-left </IressText\>
|
|
612
|
+
<IressTabSet layout\="top-left"\>
|
|
613
|
+
<IressTab label\="Address"\>
|
|
614
|
+
Address information goes here </IressTab\>
|
|
615
|
+
<IressTab label\="Employment"\>
|
|
616
|
+
Employment information goes here </IressTab\>
|
|
617
|
+
<IressTab label\="History"\>
|
|
618
|
+
Medical history goes here </IressTab\>
|
|
619
|
+
</IressTabSet\>
|
|
620
|
+
</IressPanel\>
|
|
621
|
+
<IressPanel\>
|
|
622
|
+
<IressText element\="h2"\>
|
|
623
|
+
top-center </IressText\>
|
|
624
|
+
<IressTabSet layout\="top-center"\>
|
|
625
|
+
<IressTab label\="Address"\>
|
|
626
|
+
Address information goes here </IressTab\>
|
|
627
|
+
<IressTab label\="Employment"\>
|
|
628
|
+
Employment information goes here </IressTab\>
|
|
629
|
+
<IressTab label\="History"\>
|
|
630
|
+
Medical history goes here </IressTab\>
|
|
631
|
+
</IressTabSet\>
|
|
632
|
+
</IressPanel\>
|
|
633
|
+
<IressPanel\>
|
|
634
|
+
<IressText element\="h2"\>
|
|
635
|
+
top-right </IressText\>
|
|
636
|
+
<IressTabSet layout\="top-right"\>
|
|
637
|
+
<IressTab label\="Address"\>
|
|
638
|
+
Address information goes here </IressTab\>
|
|
639
|
+
<IressTab label\="Employment"\>
|
|
640
|
+
Employment information goes here </IressTab\>
|
|
641
|
+
<IressTab label\="History"\>
|
|
642
|
+
Medical history goes here </IressTab\>
|
|
643
|
+
</IressTabSet\>
|
|
644
|
+
</IressPanel\>
|
|
645
|
+
</IressStack\>
|
|
646
|
+
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
#### Props
|
|
650
|
+
|
|
651
|
+
| Name | Description | Default | Control |
|
|
652
|
+
| --- | --- | --- | --- |
|
|
653
|
+
| children |
|
|
654
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
655
|
+
|
|
656
|
+
ReactNode
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
| \- | \- |
|
|
661
|
+
| defaultSelected |
|
|
662
|
+
|
|
663
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
664
|
+
|
|
665
|
+
FormControlValue
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
| \- | Set object |
|
|
670
|
+
| layout |
|
|
671
|
+
|
|
672
|
+
Layout options for the positioning of tabs.
|
|
673
|
+
|
|
674
|
+
union
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
|
679
|
+
|
|
680
|
+
'top-left'
|
|
681
|
+
|
|
682
|
+
| \- |
|
|
683
|
+
| onChange |
|
|
684
|
+
|
|
685
|
+
Emitted when a tab changes.
|
|
686
|
+
|
|
687
|
+
(event: TabSetChangedEventDetail) => void
|
|
688
|
+
|
|
689
|
+
| \- | \- |
|
|
690
|
+
| panelStyle |
|
|
691
|
+
|
|
692
|
+
Custom style for the panel (the area that contains the tab content).
|
|
693
|
+
|
|
694
|
+
IressCustomiseSlot
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
|
|
698
|
+
| \- | Set object |
|
|
699
|
+
| selected |
|
|
700
|
+
|
|
701
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
702
|
+
|
|
703
|
+
FormControlValue
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
| \- | Set object |
|
|
708
|
+
| tabHolderStyle |
|
|
709
|
+
|
|
710
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
711
|
+
|
|
712
|
+
IressCustomiseSlot
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
| \- | Set object |
|
|
717
|
+
|
|
718
|
+
### Lazy Loading
|
|
719
|
+
|
|
720
|
+
Tabs can be lazy loaded via state, allowing you to add/remove tabs as needed.
|
|
721
|
+
|
|
722
|
+
[](./iframe.html?id=components-tabset--lazy-loading)
|
|
723
|
+
|
|
724
|
+
Toggle tabs
|
|
725
|
+
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
import {
|
|
729
|
+
IressButton,
|
|
730
|
+
IressStack,
|
|
731
|
+
IressTab,
|
|
732
|
+
IressTabSet,
|
|
733
|
+
type IressTabSetProps,
|
|
734
|
+
} from '@iress-oss/ids-components';
|
|
735
|
+
import { useState } from 'react';
|
|
736
|
+
export const TabsLazyLoading \= () \=> {
|
|
737
|
+
const \[loadTabs, setLoadTabs\] \= useState<boolean\>();
|
|
738
|
+
return (
|
|
739
|
+
<IressStack gap\="md"\>
|
|
740
|
+
<IressButton onClick\={() \=> setLoadTabs(!loadTabs)}\>
|
|
741
|
+
Toggle tabs </IressButton\>
|
|
742
|
+
<IressTabSet {...{
|
|
743
|
+
defaultSelected: 2,
|
|
744
|
+
}}\>
|
|
745
|
+
{loadTabs && (
|
|
746
|
+
<\>
|
|
747
|
+
<IressTab label\="Address"\>Address information goes here</IressTab\>
|
|
748
|
+
<IressTab label\="Employment"\>
|
|
749
|
+
Employment information goes here </IressTab\>
|
|
750
|
+
<IressTab label\="Medical history"\>
|
|
751
|
+
Medical history goes here </IressTab\>
|
|
752
|
+
</\>
|
|
753
|
+
)}
|
|
754
|
+
</IressTabSet\>
|
|
755
|
+
</IressStack\>
|
|
756
|
+
);
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
#### Props
|
|
762
|
+
|
|
763
|
+
| Name | Description | Default | Control |
|
|
764
|
+
| --- | --- | --- | --- |
|
|
765
|
+
| children |
|
|
766
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
767
|
+
|
|
768
|
+
ReactNode
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
| \- | \- |
|
|
773
|
+
| defaultSelected |
|
|
774
|
+
|
|
775
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
776
|
+
|
|
777
|
+
FormControlValue
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
| \- |
|
|
782
|
+
|
|
783
|
+
2
|
|
784
|
+
|
|
785
|
+
|
|
|
786
|
+
| layout |
|
|
787
|
+
|
|
788
|
+
Layout options for the positioning of tabs.
|
|
789
|
+
|
|
790
|
+
union
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
|
795
|
+
|
|
796
|
+
'top-left'
|
|
797
|
+
|
|
798
|
+
|
|
|
799
|
+
|
|
800
|
+
top-lefttop-centertop-right
|
|
801
|
+
|
|
802
|
+
|
|
|
803
|
+
| onChange |
|
|
804
|
+
|
|
805
|
+
Emitted when a tab changes.
|
|
806
|
+
|
|
807
|
+
(event: TabSetChangedEventDetail) => void
|
|
808
|
+
|
|
809
|
+
| \- | \- |
|
|
810
|
+
| panelStyle |
|
|
811
|
+
|
|
812
|
+
Custom style for the panel (the area that contains the tab content).
|
|
813
|
+
|
|
814
|
+
IressCustomiseSlot
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
| \- | Set object |
|
|
819
|
+
| selected |
|
|
820
|
+
|
|
821
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
822
|
+
|
|
823
|
+
FormControlValue
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
| \- | Set object |
|
|
828
|
+
| tabHolderStyle |
|
|
829
|
+
|
|
830
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
831
|
+
|
|
832
|
+
IressCustomiseSlot
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
| \- | Set object |
|
|
837
|
+
|
|
838
|
+
### Badges and icons
|
|
839
|
+
|
|
840
|
+
You can add rich content into the `label` of the `IressTab` to customise the tab further.
|
|
841
|
+
|
|
842
|
+
Some common examples include:
|
|
843
|
+
|
|
844
|
+
* Adding a badge to the tab button.
|
|
845
|
+
* Adding icons to the tab button.
|
|
846
|
+
|
|
847
|
+
Notes:
|
|
848
|
+
|
|
849
|
+
* For best accessibility, the `IressTab` component will find the first focusable element inside the custom label to add the tab role.
|
|
850
|
+
|
|
851
|
+
[](./iframe.html?id=components-tabset--tabs-with-badges)
|
|
852
|
+
|
|
853
|
+
Address
|
|
854
|
+
|
|
855
|
+
3
|
|
856
|
+
|
|
857
|
+
Employment
|
|
858
|
+
|
|
859
|
+
History
|
|
860
|
+
|
|
861
|
+
Address information goes here
|
|
862
|
+
|
|
863
|
+
Employment information goes here
|
|
864
|
+
|
|
865
|
+
Medical history goes here
|
|
866
|
+
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
<IressTabSet\>
|
|
870
|
+
<IressBadge
|
|
871
|
+
host\={<IressTab label\="Address"\>Address information goes here</IressTab\>}
|
|
872
|
+
mode\="info"
|
|
873
|
+
pill
|
|
874
|
+
\>
|
|
875
|
+
3 </IressBadge\>
|
|
876
|
+
<IressTab label\={<IressInline gap\="sm"\><IressIcon name\="user" />{' '}Employment</IressInline\>}\>
|
|
877
|
+
Employment information goes here </IressTab\>
|
|
878
|
+
<IressTab label\="History"\>
|
|
879
|
+
Medical history goes here </IressTab\>
|
|
880
|
+
</IressTabSet\>
|
|
881
|
+
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
#### Props
|
|
885
|
+
|
|
886
|
+
| Name | Description | Default | Control |
|
|
887
|
+
| --- | --- | --- | --- |
|
|
888
|
+
| children |
|
|
889
|
+
Content to be displayed inside the IressTabs, usually multiple `IressTab`.
|
|
890
|
+
|
|
891
|
+
ReactNode
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
| \- | \- |
|
|
896
|
+
| defaultSelected |
|
|
897
|
+
|
|
898
|
+
Set the selected tab for uncontrolled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
899
|
+
|
|
900
|
+
FormControlValue
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
| \- | Set object |
|
|
905
|
+
| layout |
|
|
906
|
+
|
|
907
|
+
Layout options for the positioning of tabs.
|
|
908
|
+
|
|
909
|
+
union
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
|
|
|
914
|
+
|
|
915
|
+
'top-left'
|
|
916
|
+
|
|
917
|
+
|
|
|
918
|
+
|
|
919
|
+
top-lefttop-centertop-right
|
|
920
|
+
|
|
921
|
+
|
|
|
922
|
+
| onChange |
|
|
923
|
+
|
|
924
|
+
Emitted when a tab changes.
|
|
925
|
+
|
|
926
|
+
(event: TabSetChangedEventDetail) => void
|
|
927
|
+
|
|
928
|
+
| \- | \- |
|
|
929
|
+
| panelStyle |
|
|
930
|
+
|
|
931
|
+
Custom style for the panel (the area that contains the tab content).
|
|
932
|
+
|
|
933
|
+
IressCustomiseSlot
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
| \- | Set object |
|
|
938
|
+
| selected |
|
|
939
|
+
|
|
940
|
+
Set the selected tab for controlled tabs. If the `IressTab` does not have a `value` prop, it will match by index.
|
|
941
|
+
|
|
942
|
+
FormControlValue
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
| \- | Set object |
|
|
947
|
+
| tabHolderStyle |
|
|
948
|
+
|
|
949
|
+
Custom style for the tab holder (the area that contains the tabs).
|
|
950
|
+
|
|
951
|
+
IressCustomiseSlot
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
| \- | Set object |
|