@iress-oss/ids-mcp-server 5.15.0 → 5.20.2

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.
Files changed (134) hide show
  1. package/generated/docs/components_components-alert-docs.md +496 -0
  2. package/generated/docs/components_components-autocomplete-docs.md +3429 -0
  3. package/generated/docs/{components-autocomplete-recipes-docs.md → components_components-autocomplete-recipes-docs.md} +39 -14
  4. package/generated/docs/{components-badge-docs.md → components_components-badge-docs.md} +222 -30
  5. package/generated/docs/components_components-button-docs.md +2078 -0
  6. package/generated/docs/components_components-button-recipes-docs.md +37 -0
  7. package/generated/docs/components_components-buttongroup-docs.md +1045 -0
  8. package/generated/docs/components_components-card-docs.md +2290 -0
  9. package/generated/docs/{components-card-recipes-docs.md → components_components-card-recipes-docs.md} +132 -15
  10. package/generated/docs/components_components-checkbox-docs.md +1040 -0
  11. package/generated/docs/{components-checkboxgroup-docs.md → components_components-checkboxgroup-docs.md} +1001 -82
  12. package/generated/docs/{components-checkboxgroup-recipes-docs.md → components_components-checkboxgroup-recipes-docs.md} +102 -12
  13. package/generated/docs/{components-col-docs.md → components_components-col-docs.md} +331 -58
  14. package/generated/docs/components_components-combobox-docs.md +3735 -0
  15. package/generated/docs/{components-container-docs.md → components_components-container-docs.md} +61 -24
  16. package/generated/docs/{components-divider-docs.md → components_components-divider-docs.md} +83 -24
  17. package/generated/docs/{components-expander-docs.md → components_components-expander-docs.md} +266 -33
  18. package/generated/docs/components_components-field-docs.md +1369 -0
  19. package/generated/docs/components_components-filter-docs.md +4080 -0
  20. package/generated/docs/{components-form-docs.md → components_components-form-docs.md} +1556 -360
  21. package/generated/docs/{components-form-recipes-docs.md → components_components-form-recipes-docs.md} +277 -60
  22. package/generated/docs/{components-hide-docs.md → components_components-hide-docs.md} +195 -124
  23. package/generated/docs/components_components-icon-docs.md +1337 -0
  24. package/generated/docs/{components-inline-docs.md → components_components-inline-docs.md} +462 -42
  25. package/generated/docs/components_components-input-docs.md +1468 -0
  26. package/generated/docs/components_components-input-recipes-docs.md +367 -0
  27. package/generated/docs/components_components-inputcurrency-docs.md +432 -0
  28. package/generated/docs/{components-inputcurrency-recipes-docs.md → components_components-inputcurrency-recipes-docs.md} +113 -17
  29. package/generated/docs/components_components-label-docs.md +323 -0
  30. package/generated/docs/components_components-menu-docs.md +2345 -0
  31. package/generated/docs/components_components-menu-menuitem-docs.md +633 -0
  32. package/generated/docs/{components-modal-docs.md → components_components-modal-docs.md} +1640 -231
  33. package/generated/docs/components_components-navbar-docs.md +1847 -0
  34. package/generated/docs/{components-navbar-recipes-docs.md → components_components-navbar-recipes-docs.md} +721 -40
  35. package/generated/docs/{components-panel-docs.md → components_components-panel-docs.md} +754 -57
  36. package/generated/docs/components_components-placeholder-docs.md +92 -0
  37. package/generated/docs/components_components-popover-docs.md +1643 -0
  38. package/generated/docs/components_components-popover-recipes-docs.md +491 -0
  39. package/generated/docs/components_components-progress-docs.md +115 -0
  40. package/generated/docs/{components-provider-docs.md → components_components-provider-docs.md} +42 -33
  41. package/generated/docs/components_components-radio-docs.md +491 -0
  42. package/generated/docs/{components-radiogroup-docs.md → components_components-radiogroup-docs.md} +927 -75
  43. package/generated/docs/components_components-readonly-docs.md +263 -0
  44. package/generated/docs/components_components-richselect-docs.md +6521 -0
  45. package/generated/docs/{components-row-docs.md → components_components-row-docs.md} +353 -43
  46. package/generated/docs/{components-select-docs.md → components_components-select-docs.md} +719 -61
  47. package/generated/docs/components_components-skeleton-docs.md +480 -0
  48. package/generated/docs/{components-skeleton-recipes-docs.md → components_components-skeleton-recipes-docs.md} +51 -11
  49. package/generated/docs/{components-skiplink-docs.md → components_components-skiplink-docs.md} +53 -14
  50. package/generated/docs/components_components-slideout-docs.md +2293 -0
  51. package/generated/docs/components_components-slider-docs.md +1276 -0
  52. package/generated/docs/components_components-spinner-docs.md +82 -0
  53. package/generated/docs/{components-stack-docs.md → components_components-stack-docs.md} +223 -40
  54. package/generated/docs/components_components-table-docs.md +3658 -0
  55. package/generated/docs/components_components-tabset-docs.md +772 -0
  56. package/generated/docs/components_components-tabset-tab-docs.md +262 -0
  57. package/generated/docs/components_components-tag-docs.md +257 -0
  58. package/generated/docs/{components-text-docs.md → components_components-text-docs.md} +491 -51
  59. package/generated/docs/{components-toaster-docs.md → components_components-toaster-docs.md} +187 -85
  60. package/generated/docs/components_components-toaster-toast-docs.md +634 -0
  61. package/generated/docs/components_components-toggle-docs.md +461 -0
  62. package/generated/docs/{components-tooltip-docs.md → components_components-tooltip-docs.md} +286 -41
  63. package/generated/docs/{components-validationmessage-docs.md → components_components-validationmessage-docs.md} +230 -61
  64. package/generated/docs/components_contact-us-docs.md +12 -0
  65. package/generated/docs/{foundations-accessibility-docs.md → components_foundations-accessibility-docs.md} +11 -21
  66. package/generated/docs/{foundations-colours-docs.md → components_foundations-colour-030-colours.md} +8 -15
  67. package/generated/docs/{foundations-consistency-docs.md → components_foundations-consistency-docs.md} +12 -20
  68. package/generated/docs/{foundations-content-docs.md → components_foundations-content-docs.md} +6 -11
  69. package/generated/docs/components_foundations-introduction-docs.md +15 -0
  70. package/generated/docs/{foundations-principles-docs.md → components_foundations-principles-docs.md} +14 -24
  71. package/generated/docs/components_foundations-typography-docs.md +608 -0
  72. package/generated/docs/{foundations-user-experience-docs.md → components_foundations-user-experience-docs.md} +16 -26
  73. package/generated/docs/{foundations-visual-design-docs.md → components_foundations-visual-design-docs.md} +10 -17
  74. package/generated/docs/{frequently-asked-questions-docs.md → components_frequently-asked-questions-docs.md} +14 -23
  75. package/generated/docs/components_get-started-develop-docs.md +84 -0
  76. package/generated/docs/components_get-started-using-storybook-docs.md +55 -0
  77. package/generated/docs/components_introduction-docs.md +15 -0
  78. package/generated/docs/{patterns-loading-docs.md → components_patterns-loading-docs.md} +798 -153
  79. package/generated/docs/components_resources-changelog-docs.md +4 -0
  80. package/generated/docs/{resources-code-katas-docs.md → components_resources-code-katas-docs.md} +5 -9
  81. package/generated/docs/{resources-migration-guides-from-v4-to-v5-docs.md → components_resources-migration-guides-from-v4-to-v5-docs.md} +54 -239
  82. package/generated/docs/components_sandbox-docs.md +4 -0
  83. package/generated/docs/{versions-docs.md → components_versions-docs.md} +5 -8
  84. package/generated/docs/guidelines.md +484 -200
  85. package/generated/docs/introduction-docs.md +19 -30
  86. package/package.json +41 -45
  87. package/generated/docs/components-alert-docs.md +0 -130
  88. package/generated/docs/components-autocomplete-docs.md +0 -754
  89. package/generated/docs/components-button-docs.md +0 -362
  90. package/generated/docs/components-button-recipes-docs.md +0 -76
  91. package/generated/docs/components-buttongroup-docs.md +0 -310
  92. package/generated/docs/components-card-docs.md +0 -494
  93. package/generated/docs/components-checkbox-docs.md +0 -193
  94. package/generated/docs/components-combobox-docs.md +0 -1016
  95. package/generated/docs/components-field-docs.md +0 -675
  96. package/generated/docs/components-filter-docs.md +0 -1109
  97. package/generated/docs/components-icon-docs.md +0 -553
  98. package/generated/docs/components-input-docs.md +0 -335
  99. package/generated/docs/components-input-recipes-docs.md +0 -140
  100. package/generated/docs/components-inputcurrency-docs.md +0 -157
  101. package/generated/docs/components-label-docs.md +0 -135
  102. package/generated/docs/components-menu-docs.md +0 -704
  103. package/generated/docs/components-menu-menuitem-docs.md +0 -193
  104. package/generated/docs/components-navbar-docs.md +0 -291
  105. package/generated/docs/components-placeholder-docs.md +0 -27
  106. package/generated/docs/components-popover-docs.md +0 -464
  107. package/generated/docs/components-popover-recipes-docs.md +0 -245
  108. package/generated/docs/components-progress-docs.md +0 -104
  109. package/generated/docs/components-radio-docs.md +0 -107
  110. package/generated/docs/components-readonly-docs.md +0 -89
  111. package/generated/docs/components-richselect-docs.md +0 -2433
  112. package/generated/docs/components-skeleton-docs.md +0 -214
  113. package/generated/docs/components-slideout-docs.md +0 -538
  114. package/generated/docs/components-slider-docs.md +0 -346
  115. package/generated/docs/components-spinner-docs.md +0 -59
  116. package/generated/docs/components-table-ag-grid-docs.md +0 -1074
  117. package/generated/docs/components-table-docs.md +0 -1305
  118. package/generated/docs/components-tabset-docs.md +0 -341
  119. package/generated/docs/components-tabset-tab-docs.md +0 -86
  120. package/generated/docs/components-tag-docs.md +0 -115
  121. package/generated/docs/components-toaster-toast-docs.md +0 -157
  122. package/generated/docs/components-toggle-docs.md +0 -158
  123. package/generated/docs/contact-us-docs.md +0 -27
  124. package/generated/docs/extensions-editor-docs.md +0 -288
  125. package/generated/docs/extensions-editor-recipes-docs.md +0 -39
  126. package/generated/docs/foundations-introduction-docs.md +0 -17
  127. package/generated/docs/foundations-typography-docs.md +0 -191
  128. package/generated/docs/get-started-develop-docs.md +0 -209
  129. package/generated/docs/get-started-using-storybook-docs.md +0 -68
  130. package/generated/docs/resources-changelog-docs.md +0 -6
  131. package/generated/docs/themes-available-themes-docs.md +0 -66
  132. package/generated/docs/themes-introduction-docs.md +0 -121
  133. package/generated/docs/themes-tokens-docs.md +0 -1200
  134. /package/{LICENSE.txt → LICENSE} +0 -0
@@ -0,0 +1,3735 @@
1
+ Combobox
2
+ ========
3
+
4
+ Overview
5
+ --------
6
+
7
+ Comboboxes provide select and multi-select functionality with the benefit of live filtering.
8
+
9
+ * * *
10
+
11
+ Caution
12
+
13
+ **Use IressRichSelect instead**
14
+
15
+ The design of this component is changing. Please use the new component/props instead.
16
+
17
+ [](./iframe.html?id=components-combobox--default)
18
+
19
+ None selected
20
+
21
+ Hide codedrawOpen in CodeSandbox
22
+
23
+ <IressCombobox
24
+ options\={\[
25
+ {
26
+ label: 'Option 1',
27
+ value: 1
28
+ },
29
+ {
30
+ label: 'Option 2',
31
+ value: 2
32
+ },
33
+ {
34
+ label: 'Option 3',
35
+ value: 3
36
+ },
37
+ {
38
+ label: 'Option 4',
39
+ value: 4
40
+ },
41
+ {
42
+ label: 'Option 5',
43
+ value: 5
44
+ }
45
+ \]}
46
+ popoverProps\={{
47
+ container: {}
48
+ }}
49
+ />
50
+
51
+ ```
52
+
53
+ Props
54
+ -----
55
+
56
+ | Name | Description | Default | Control |
57
+ | --- | --- | --- | --- |
58
+ | append |
59
+ |
60
+
61
+ <IressIcon />
62
+
63
+ | Set object |
64
+ | autoComplete |
65
+
66
+ |
67
+
68
+ 'off'
69
+
70
+ | Set object |
71
+ | autoSelect |
72
+
73
+ |
74
+
75
+ true
76
+
77
+ | Set object |
78
+ | clearable |
79
+
80
+ |
81
+
82
+ true
83
+
84
+ | Set object |
85
+ | defaultValue |
86
+
87
+ Value of selected option for uncontrolled combobox.
88
+
89
+ LabelValueMeta
90
+
91
+
92
+
93
+ | \- | Set object |
94
+ | hiddenInputProps |
95
+
96
+ Add additional props to the hidden input.
97
+
98
+ Omit
99
+
100
+
101
+
102
+ | \- | Set object |
103
+ | limitDesktop |
104
+
105
+ |
106
+
107
+ 12
108
+
109
+ | Set object |
110
+ | limitMobile |
111
+
112
+ |
113
+
114
+ 6
115
+
116
+ | Set object |
117
+ | onChange |
118
+
119
+ Emitted when the value changes.
120
+
121
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
122
+
123
+ | \- | \- |
124
+ | options\* |
125
+
126
+ Options data set, the available options that the user can select from.
127
+
128
+ union
129
+
130
+
131
+
132
+ | \- |
133
+
134
+ Edit JSON
135
+
136
+ * options :
137
+
138
+ \[
139
+
140
+ * 0 :
141
+
142
+ {...} 2 keys
143
+
144
+ * 1 :
145
+
146
+ {...} 2 keys
147
+
148
+ * 2 :
149
+
150
+ {...} 2 keys
151
+
152
+ * 3 :
153
+
154
+ {...} 2 keys
155
+
156
+ * 4 :
157
+
158
+ {...} 2 keys
159
+
160
+
161
+ \]
162
+
163
+
164
+
165
+
166
+ |
167
+ | popoverProps |
168
+
169
+ object
170
+
171
+
172
+
173
+ | { } |
174
+
175
+ Edit JSON
176
+
177
+ popoverProps :
178
+
179
+ {
180
+
181
+ }
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ |
190
+ | value |
191
+
192
+ Value of selected option for controlled combobox.
193
+
194
+ LabelValueMeta
195
+
196
+
197
+
198
+ | \- | Set object |
199
+ | watermark |
200
+
201
+ |
202
+
203
+ true
204
+
205
+ | Set object |
206
+
207
+ Usage
208
+ -----
209
+
210
+ `IressCombobox` is an alternative to `IressSelect` when you have a large number of options and want to provide a search functionality to help the user find the option they are looking for.
211
+
212
+ It extends `IressAutocomplete`, however it restricts the input to the options provided. This means that the user can only select from the options provided. If you do not need this restriction, please use `IressAutocomplete`.
213
+
214
+ ### Uncontrolled
215
+
216
+ The `defaultValue` prop can be used to set the initial value of the combobox. The value will be managed by the component.
217
+
218
+ **Note:** The `defaultValue` prop is not checked against the options provided, allowing it to work with asynchronous options.
219
+
220
+ [](./iframe.html?id=components-combobox--uncontrolled)
221
+
222
+ ×Clear
223
+
224
+ None selected
225
+
226
+ Hide codedrawOpen in CodeSandbox
227
+
228
+ <IressCombobox
229
+ defaultValue\={{
230
+ label: 'Option 1',
231
+ value: 1
232
+ }}
233
+ options\={\[
234
+ {
235
+ label: 'Option 1',
236
+ value: 1
237
+ },
238
+ {
239
+ label: 'Option 2',
240
+ value: 2
241
+ },
242
+ {
243
+ label: 'Option 3',
244
+ value: 3
245
+ },
246
+ {
247
+ label: 'Option 4',
248
+ value: 4
249
+ },
250
+ {
251
+ label: 'Option 5',
252
+ value: 5
253
+ }
254
+ \]}
255
+ popoverProps\={{
256
+ container: {}
257
+ }}
258
+ />
259
+
260
+ ```
261
+
262
+ #### Props
263
+
264
+ | Name | Description | Default | Control |
265
+ | --- | --- | --- | --- |
266
+ | append |
267
+ |
268
+
269
+ <IressIcon />
270
+
271
+ | Set object |
272
+ | autoComplete |
273
+
274
+ |
275
+
276
+ 'off'
277
+
278
+ | Set object |
279
+ | autoSelect |
280
+
281
+ |
282
+
283
+ true
284
+
285
+ | Set object |
286
+ | clearable |
287
+
288
+ |
289
+
290
+ true
291
+
292
+ | Set object |
293
+ | defaultValue |
294
+
295
+ Value of selected option for uncontrolled combobox.
296
+
297
+ LabelValueMeta
298
+
299
+
300
+
301
+ | \- |
302
+
303
+ Edit JSON
304
+
305
+ defaultValue :
306
+
307
+ {
308
+
309
+ * label : "Option 1"
310
+ * value : 1
311
+
312
+ }
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+ |
321
+ | hiddenInputProps |
322
+
323
+ Add additional props to the hidden input.
324
+
325
+ Omit
326
+
327
+
328
+
329
+ | \- | Set object |
330
+ | limitDesktop |
331
+
332
+ |
333
+
334
+ 12
335
+
336
+ | Set object |
337
+ | limitMobile |
338
+
339
+ |
340
+
341
+ 6
342
+
343
+ | Set object |
344
+ | onChange |
345
+
346
+ Emitted when the value changes.
347
+
348
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
349
+
350
+ | \- | \- |
351
+ | options\* |
352
+
353
+ Options data set, the available options that the user can select from.
354
+
355
+ union
356
+
357
+
358
+
359
+ | \- |
360
+
361
+ Edit JSON
362
+
363
+ * options :
364
+
365
+ \[
366
+
367
+ * 0 :
368
+
369
+ {...} 2 keys
370
+
371
+ * 1 :
372
+
373
+ {...} 2 keys
374
+
375
+ * 2 :
376
+
377
+ {...} 2 keys
378
+
379
+ * 3 :
380
+
381
+ {...} 2 keys
382
+
383
+ * 4 :
384
+
385
+ {...} 2 keys
386
+
387
+
388
+ \]
389
+
390
+
391
+
392
+
393
+ |
394
+ | popoverProps |
395
+
396
+ object
397
+
398
+
399
+
400
+ | { } |
401
+
402
+ Edit JSON
403
+
404
+ popoverProps :
405
+
406
+ {
407
+
408
+ }
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+ |
417
+ | value |
418
+
419
+ Value of selected option for controlled combobox.
420
+
421
+ LabelValueMeta
422
+
423
+
424
+
425
+ | \- | Set object |
426
+ | watermark |
427
+
428
+ |
429
+
430
+ true
431
+
432
+ | Set object |
433
+
434
+ ### Controlled
435
+
436
+ The `value` prop can be used to completely control the state of the component. Use the `onChange` and `onClear` props to sync your state with the component.
437
+
438
+ **Note:** The `value` prop is not checked against the options provided, allowing it to work with asynchronous options.
439
+
440
+ [](./iframe.html?id=components-combobox--controlled)
441
+
442
+ None selected
443
+
444
+ Hide codedrawOpen in CodeSandbox
445
+
446
+ import {
447
+ IressCombobox,
448
+ type IressComboboxProps,
449
+ type LabelValueMeta,
450
+ } from '@/main';
451
+ import { useState } from 'react';
452
+ export const ComboboxUsingState \= () \=> {
453
+ const \[value, setValue\] \= useState<LabelValueMeta | undefined\>();
454
+ return (
455
+ <IressCombobox
456
+ {...{
457
+ popoverProps: {
458
+ container: {},
459
+ },
460
+ options: \[
461
+ {
462
+ label: 'Option 1',
463
+ value: 1,
464
+ },
465
+ {
466
+ label: 'Option 2',
467
+ value: 2,
468
+ },
469
+ {
470
+ label: 'Option 3',
471
+ value: 3,
472
+ },
473
+ {
474
+ label: 'Option 4',
475
+ value: 4,
476
+ },
477
+ {
478
+ label: 'Option 5',
479
+ value: 5,
480
+ },
481
+ \],
482
+ }}
483
+ onChange\={(\_e, newValue) \=> setValue(newValue)}
484
+ onClear\={() \=> setValue(undefined)}
485
+ value\={value}
486
+ />
487
+ );
488
+ };
489
+
490
+ ```
491
+
492
+ #### Props
493
+
494
+ | Name | Description | Default | Control |
495
+ | --- | --- | --- | --- |
496
+ | append |
497
+ |
498
+
499
+ <IressIcon />
500
+
501
+ | Set object |
502
+ | autoComplete |
503
+
504
+ |
505
+
506
+ 'off'
507
+
508
+ | Set object |
509
+ | autoSelect |
510
+
511
+ |
512
+
513
+ true
514
+
515
+ | Set object |
516
+ | clearable |
517
+
518
+ |
519
+
520
+ true
521
+
522
+ | Set object |
523
+ | defaultValue |
524
+
525
+ Value of selected option for uncontrolled combobox.
526
+
527
+ LabelValueMeta
528
+
529
+
530
+
531
+ | \- | \- |
532
+ | hiddenInputProps |
533
+
534
+ Add additional props to the hidden input.
535
+
536
+ Omit
537
+
538
+
539
+
540
+ | \- | Set object |
541
+ | limitDesktop |
542
+
543
+ |
544
+
545
+ 12
546
+
547
+ | Set object |
548
+ | limitMobile |
549
+
550
+ |
551
+
552
+ 6
553
+
554
+ | Set object |
555
+ | onChange |
556
+
557
+ Emitted when the value changes.
558
+
559
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
560
+
561
+ | \- | \- |
562
+ | options\* |
563
+
564
+ Options data set, the available options that the user can select from.
565
+
566
+ union
567
+
568
+
569
+
570
+ | \- |
571
+
572
+ Edit JSON
573
+
574
+ * options :
575
+
576
+ \[
577
+
578
+ * 0 :
579
+
580
+ {...} 2 keys
581
+
582
+ * 1 :
583
+
584
+ {...} 2 keys
585
+
586
+ * 2 :
587
+
588
+ {...} 2 keys
589
+
590
+ * 3 :
591
+
592
+ {...} 2 keys
593
+
594
+ * 4 :
595
+
596
+ {...} 2 keys
597
+
598
+
599
+ \]
600
+
601
+
602
+
603
+
604
+ |
605
+ | popoverProps |
606
+
607
+ object
608
+
609
+
610
+
611
+ | { } |
612
+
613
+ Edit JSON
614
+
615
+ popoverProps :
616
+
617
+ {
618
+
619
+ }
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+ |
628
+ | value |
629
+
630
+ Value of selected option for controlled combobox.
631
+
632
+ LabelValueMeta
633
+
634
+
635
+
636
+ | \- | \- |
637
+ | watermark |
638
+
639
+ |
640
+
641
+ true
642
+
643
+ | Set object |
644
+
645
+ ### Providing options
646
+
647
+ #### `options`
648
+
649
+ The `options` prop is required for the combobox. You can provide an array of `LabelValueMeta[]` objects to the `options` prop. Filtering is done based on the `label` property.
650
+
651
+ [](./iframe.html?id=components-combobox--options)
652
+
653
+ None selected
654
+
655
+ Hide codedrawOpen in CodeSandbox
656
+
657
+ <IressCombobox
658
+ options\={\[
659
+ {
660
+ label: 'Option 1',
661
+ value: 1
662
+ },
663
+ {
664
+ label: 'Option 2',
665
+ value: 2
666
+ },
667
+ {
668
+ label: 'Option 3',
669
+ value: 3
670
+ },
671
+ {
672
+ label: 'Option 4',
673
+ value: 4
674
+ },
675
+ {
676
+ label: 'Option 5',
677
+ value: 5
678
+ }
679
+ \]}
680
+ popoverProps\={{
681
+ container: {}
682
+ }}
683
+ />
684
+
685
+ ```
686
+
687
+ #### Props
688
+
689
+ | Name | Description | Default | Control |
690
+ | --- | --- | --- | --- |
691
+ | append |
692
+ |
693
+
694
+ <IressIcon />
695
+
696
+ | Set object |
697
+ | autoComplete |
698
+
699
+ |
700
+
701
+ 'off'
702
+
703
+ | Set object |
704
+ | autoSelect |
705
+
706
+ |
707
+
708
+ true
709
+
710
+ | Set object |
711
+ | clearable |
712
+
713
+ |
714
+
715
+ true
716
+
717
+ | Set object |
718
+ | defaultValue |
719
+
720
+ Value of selected option for uncontrolled combobox.
721
+
722
+ LabelValueMeta
723
+
724
+
725
+
726
+ | \- | Set object |
727
+ | hiddenInputProps |
728
+
729
+ Add additional props to the hidden input.
730
+
731
+ Omit
732
+
733
+
734
+
735
+ | \- | Set object |
736
+ | limitDesktop |
737
+
738
+ |
739
+
740
+ 12
741
+
742
+ | Set object |
743
+ | limitMobile |
744
+
745
+ |
746
+
747
+ 6
748
+
749
+ | Set object |
750
+ | onChange |
751
+
752
+ Emitted when the value changes.
753
+
754
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
755
+
756
+ | \- | \- |
757
+ | options\* |
758
+
759
+ Options data set, the available options that the user can select from.
760
+
761
+ union
762
+
763
+
764
+
765
+ | \- |
766
+
767
+ Edit JSON
768
+
769
+ * options :
770
+
771
+ \[
772
+
773
+ * 0 :
774
+
775
+ {...} 2 keys
776
+
777
+ * 1 :
778
+
779
+ {...} 2 keys
780
+
781
+ * 2 :
782
+
783
+ {...} 2 keys
784
+
785
+ * 3 :
786
+
787
+ {...} 2 keys
788
+
789
+ * 4 :
790
+
791
+ {...} 2 keys
792
+
793
+
794
+ \]
795
+
796
+
797
+
798
+
799
+ |
800
+ | popoverProps |
801
+
802
+ object
803
+
804
+
805
+
806
+ | { } |
807
+
808
+ Edit JSON
809
+
810
+ popoverProps :
811
+
812
+ {
813
+
814
+ }
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+ |
823
+ | value |
824
+
825
+ Value of selected option for controlled combobox.
826
+
827
+ LabelValueMeta
828
+
829
+
830
+
831
+ | \- | Set object |
832
+ | watermark |
833
+
834
+ |
835
+
836
+ true
837
+
838
+ | Set object |
839
+
840
+ #### Asynchronous `options`
841
+
842
+ If you would like to render suggestions from the server, you can pass a function to the `options` prop. It accepts a string parameter and returns a promise that resolves to an array of `LabelValueMeta[]` objects. No filtering is done for asynchronous options, you must filter the options yourself using the query.
843
+
844
+ [](./iframe.html?id=components-combobox--async-options)
845
+
846
+ None selected
847
+
848
+ Hide codedrawOpen in CodeSandbox
849
+
850
+ import { IressCombobox, type IressComboboxProps } from '@/main';
851
+ interface StarWarsCharacter {
852
+ name: string;
853
+ gender: string;
854
+ }
855
+ interface StarWarsCharacterApi {
856
+ results: StarWarsCharacter\[\];
857
+ }
858
+ export const ComboboxUsingAsync \= (args: IressComboboxProps) \=> (
859
+ <IressCombobox
860
+ {...args}
861
+ options\={async (query: string) \=> {
862
+ if (!query) return \[\];
863
+ const data \= await fetch(
864
+ \`https://swapi.py4e.com/api/people/?search=${query}\`,
865
+ ).then((response) \=> response.json() as Promise<StarWarsCharacterApi\>);
866
+ return data.results.map((character: StarWarsCharacter) \=> ({
867
+ label: character.name,
868
+ value: character.name,
869
+ meta: character.gender,
870
+ }));
871
+ }}
872
+ />
873
+ );
874
+
875
+ ```
876
+
877
+ #### Props
878
+
879
+ | Name | Description | Default | Control |
880
+ | --- | --- | --- | --- |
881
+ | append |
882
+ |
883
+
884
+ <IressIcon />
885
+
886
+ | Set object |
887
+ | autoComplete |
888
+
889
+ |
890
+
891
+ 'off'
892
+
893
+ | Set object |
894
+ | autoSelect |
895
+
896
+ |
897
+
898
+ true
899
+
900
+ | Set object |
901
+ | clearable |
902
+
903
+ |
904
+
905
+ true
906
+
907
+ | Set object |
908
+ | defaultValue |
909
+
910
+ Value of selected option for uncontrolled combobox.
911
+
912
+ LabelValueMeta
913
+
914
+
915
+
916
+ | \- | Set object |
917
+ | hiddenInputProps |
918
+
919
+ Add additional props to the hidden input.
920
+
921
+ Omit
922
+
923
+
924
+
925
+ | \- | Set object |
926
+ | limitDesktop |
927
+
928
+ |
929
+
930
+ 12
931
+
932
+ | Set object |
933
+ | limitMobile |
934
+
935
+ |
936
+
937
+ 6
938
+
939
+ | Set object |
940
+ | onChange |
941
+
942
+ Emitted when the value changes.
943
+
944
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
945
+
946
+ | \- | \- |
947
+ | options\* |
948
+
949
+ Options data set, the available options that the user can select from.
950
+
951
+ union
952
+
953
+
954
+
955
+ | \- | \- |
956
+ | popoverProps |
957
+
958
+ object
959
+
960
+
961
+
962
+ | { } |
963
+
964
+ Edit JSON
965
+
966
+ popoverProps :
967
+
968
+ {
969
+
970
+ }
971
+
972
+
973
+
974
+
975
+
976
+
977
+
978
+ |
979
+ | value |
980
+
981
+ Value of selected option for controlled combobox.
982
+
983
+ LabelValueMeta
984
+
985
+
986
+
987
+ | \- | Set object |
988
+ | watermark |
989
+
990
+ |
991
+
992
+ true
993
+
994
+ | Set object |
995
+
996
+ #### `initialOptions`
997
+
998
+ If you want to provide initial options to the user, you can use the `initialOptions` prop. This is useful when you want to provide a list of options to the user before they start typing (eg. recommended search terms).
999
+
1000
+ **Note:** Once an option is selected from `initialOptions`, the input will be updated, meaning that the user can no longer see the initial options. If you want to keep the initial options visible, you should make sure they are part of the `options` prop as well.
1001
+
1002
+ [](./iframe.html?id=components-combobox--initial-options)
1003
+
1004
+ None selected
1005
+
1006
+ Hide codedrawOpen in CodeSandbox
1007
+
1008
+ <IressCombobox
1009
+ initialOptions\={\[
1010
+ {
1011
+ label: 'Favourite option 1'
1012
+ },
1013
+ {
1014
+ label: 'Favourite option 2'
1015
+ },
1016
+ {
1017
+ label: 'Favourite option 3'
1018
+ }
1019
+ \]}
1020
+ options\={\[
1021
+ {
1022
+ label: 'Option 1',
1023
+ value: 1
1024
+ },
1025
+ {
1026
+ label: 'Option 2',
1027
+ value: 2
1028
+ },
1029
+ {
1030
+ label: 'Option 3',
1031
+ value: 3
1032
+ },
1033
+ {
1034
+ label: 'Option 4',
1035
+ value: 4
1036
+ },
1037
+ {
1038
+ label: 'Option 5',
1039
+ value: 5
1040
+ }
1041
+ \]}
1042
+ popoverProps\={{
1043
+ container: {}
1044
+ }}
1045
+ />
1046
+
1047
+ ```
1048
+
1049
+ #### Props
1050
+
1051
+ | Name | Description | Default | Control |
1052
+ | --- | --- | --- | --- |
1053
+ | append |
1054
+ |
1055
+
1056
+ <IressIcon />
1057
+
1058
+ | Set object |
1059
+ | autoComplete |
1060
+
1061
+ |
1062
+
1063
+ 'off'
1064
+
1065
+ | Set object |
1066
+ | autoSelect |
1067
+
1068
+ |
1069
+
1070
+ true
1071
+
1072
+ | Set object |
1073
+ | clearable |
1074
+
1075
+ |
1076
+
1077
+ true
1078
+
1079
+ | Set object |
1080
+ | defaultValue |
1081
+
1082
+ Value of selected option for uncontrolled combobox.
1083
+
1084
+ LabelValueMeta
1085
+
1086
+
1087
+
1088
+ | \- | Set object |
1089
+ | hiddenInputProps |
1090
+
1091
+ Add additional props to the hidden input.
1092
+
1093
+ Omit
1094
+
1095
+
1096
+
1097
+ | \- | Set object |
1098
+ | initialOptions |
1099
+
1100
+ array
1101
+
1102
+
1103
+
1104
+ | \- |
1105
+
1106
+ Edit JSON
1107
+
1108
+ * initialOptions :
1109
+
1110
+ \[
1111
+
1112
+ * 0 :
1113
+
1114
+ {...} 1 key
1115
+
1116
+ * 1 :
1117
+
1118
+ {...} 1 key
1119
+
1120
+ * 2 :
1121
+
1122
+ {...} 1 key
1123
+
1124
+
1125
+ \]
1126
+
1127
+
1128
+
1129
+
1130
+ |
1131
+ | limitDesktop |
1132
+
1133
+ |
1134
+
1135
+ 12
1136
+
1137
+ | Set object |
1138
+ | limitMobile |
1139
+
1140
+ |
1141
+
1142
+ 6
1143
+
1144
+ | Set object |
1145
+ | onChange |
1146
+
1147
+ Emitted when the value changes.
1148
+
1149
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1150
+
1151
+ | \- | \- |
1152
+ | options\* |
1153
+
1154
+ Options data set, the available options that the user can select from.
1155
+
1156
+ union
1157
+
1158
+
1159
+
1160
+ | \- |
1161
+
1162
+ Edit JSON
1163
+
1164
+ * options :
1165
+
1166
+ \[
1167
+
1168
+ * 0 :
1169
+
1170
+ {...} 2 keys
1171
+
1172
+ * 1 :
1173
+
1174
+ {...} 2 keys
1175
+
1176
+ * 2 :
1177
+
1178
+ {...} 2 keys
1179
+
1180
+ * 3 :
1181
+
1182
+ {...} 2 keys
1183
+
1184
+ * 4 :
1185
+
1186
+ {...} 2 keys
1187
+
1188
+
1189
+ \]
1190
+
1191
+
1192
+
1193
+
1194
+ |
1195
+ | popoverProps |
1196
+
1197
+ object
1198
+
1199
+
1200
+
1201
+ | { } |
1202
+
1203
+ Edit JSON
1204
+
1205
+ popoverProps :
1206
+
1207
+ {
1208
+
1209
+ }
1210
+
1211
+
1212
+
1213
+
1214
+
1215
+
1216
+
1217
+ |
1218
+ | value |
1219
+
1220
+ Value of selected option for controlled combobox.
1221
+
1222
+ LabelValueMeta
1223
+
1224
+
1225
+
1226
+ | \- | Set object |
1227
+ | watermark |
1228
+
1229
+ |
1230
+
1231
+ true
1232
+
1233
+ | Set object |
1234
+
1235
+ Behaviour
1236
+ ---------
1237
+
1238
+ * If `initialOptions` are provided the options will be displayed in a popover immediately on focus. The popover will close when the input loses focus.
1239
+ * If `initialOptions` are not provided, the popover will be displayed as long as there is a single character in the input. The popover will close when the input is empty.
1240
+ * The options will be filtered based on the input value.
1241
+ * If `autoSelect` is true, the first option filtered will become the value of the combobox, unless the backspace key is pressed.
1242
+ * Tapping on an option with the mouse will change the input value to the `label` of the selected option. The entire `LabelValueMeta` of the selected option will be returned in the `onChange` callback.
1243
+ * When the user presses the arrow keys while the input is focussed, options will be selected, but focus remains on the input.
1244
+ * If `autoSelect` is true, the option will become the value of the combobox.
1245
+ * If `autoSelect` is true, the text not matching the input will be selected.
1246
+ * When the user presses the enter key while a option is highlighted, the option will be selected and the popover will close.
1247
+ * When the user presses the down key while the popover is closed, it will open the popover.
1248
+ * When the user pressed the up key while the first option is highlighted, it will close the popover.
1249
+ * When the user tabs away while the popover is open, the popover will close.
1250
+ * If `autoSelect` is true and there is a highlighted option, it will become the value of the combobox.
1251
+
1252
+ Accessibility
1253
+ -------------
1254
+
1255
+ The autocomplete component follows the [WAI combobox pattern: List with inline autocomplete and automatic selection](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/#:~:text=List%20autocomplete%20with%20automatic,has%20a%20selected%20state). An example of this pattern outside of IDS can be seen at [WAI-ARIA combobox example](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-both/).
1256
+
1257
+ There is a key difference:
1258
+
1259
+ * For better usability, virtual focus is used to highlight the suggestions inside the popover. This means focus remains on the input, but the suggestions are highlighted as if they are in focus, allowing the user to type and navigate the suggestions with the arrow keys.
1260
+ * To denote the highlighted suggestion to screen readers, the `aria-activedescendant` attribute is used.
1261
+
1262
+ Examples
1263
+ --------
1264
+
1265
+ ### Remove `autoSelect`
1266
+
1267
+ The `autoSelect` prop will automatically select the highlighted option. This is set to true by default, but can be switched off, in which case the user must interact with the popover to select an option.
1268
+
1269
+ [](./iframe.html?id=components-combobox--remove-auto-select)
1270
+
1271
+ None selected
1272
+
1273
+ Hide codedrawOpen in CodeSandbox
1274
+
1275
+ <IressCombobox
1276
+ autoSelect\={false}
1277
+ options\={\[
1278
+ {
1279
+ label: 'Option 1',
1280
+ value: 1
1281
+ },
1282
+ {
1283
+ label: 'Option 2',
1284
+ value: 2
1285
+ },
1286
+ {
1287
+ label: 'Option 3',
1288
+ value: 3
1289
+ },
1290
+ {
1291
+ label: 'Option 4',
1292
+ value: 4
1293
+ },
1294
+ {
1295
+ label: 'Option 5',
1296
+ value: 5
1297
+ }
1298
+ \]}
1299
+ placeholder\="Should no longer auto-select when an item is highlighted"
1300
+ popoverProps\={{
1301
+ container: {}
1302
+ }}
1303
+ />
1304
+
1305
+ ```
1306
+
1307
+ #### Props
1308
+
1309
+ | Name | Description | Default | Control |
1310
+ | --- | --- | --- | --- |
1311
+ | append |
1312
+ |
1313
+
1314
+ <IressIcon />
1315
+
1316
+ | Set object |
1317
+ | autoComplete |
1318
+
1319
+ |
1320
+
1321
+ 'off'
1322
+
1323
+ | Set object |
1324
+ | autoSelect |
1325
+
1326
+ boolean
1327
+
1328
+
1329
+
1330
+ |
1331
+
1332
+ true
1333
+
1334
+ | FalseTrue |
1335
+ | clearable |
1336
+
1337
+ |
1338
+
1339
+ true
1340
+
1341
+ | Set object |
1342
+ | defaultValue |
1343
+
1344
+ Value of selected option for uncontrolled combobox.
1345
+
1346
+ LabelValueMeta
1347
+
1348
+
1349
+
1350
+ | \- | Set object |
1351
+ | hiddenInputProps |
1352
+
1353
+ Add additional props to the hidden input.
1354
+
1355
+ Omit
1356
+
1357
+
1358
+
1359
+ | \- | Set object |
1360
+ | limitDesktop |
1361
+
1362
+ |
1363
+
1364
+ 12
1365
+
1366
+ | Set object |
1367
+ | limitMobile |
1368
+
1369
+ |
1370
+
1371
+ 6
1372
+
1373
+ | Set object |
1374
+ | onChange |
1375
+
1376
+ Emitted when the value changes.
1377
+
1378
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1379
+
1380
+ | \- | \- |
1381
+ | options\* |
1382
+
1383
+ Options data set, the available options that the user can select from.
1384
+
1385
+ union
1386
+
1387
+
1388
+
1389
+ | \- |
1390
+
1391
+ Edit JSON
1392
+
1393
+ * options :
1394
+
1395
+ \[
1396
+
1397
+ * 0 :
1398
+
1399
+ {...} 2 keys
1400
+
1401
+ * 1 :
1402
+
1403
+ {...} 2 keys
1404
+
1405
+ * 2 :
1406
+
1407
+ {...} 2 keys
1408
+
1409
+ * 3 :
1410
+
1411
+ {...} 2 keys
1412
+
1413
+ * 4 :
1414
+
1415
+ {...} 2 keys
1416
+
1417
+
1418
+ \]
1419
+
1420
+
1421
+
1422
+
1423
+ |
1424
+ | placeholder |
1425
+
1426
+ string
1427
+
1428
+
1429
+
1430
+ | \- | Should no longer auto-select when an item is highlighted |
1431
+ | popoverProps |
1432
+
1433
+ object
1434
+
1435
+
1436
+
1437
+ | { } |
1438
+
1439
+ Edit JSON
1440
+
1441
+ popoverProps :
1442
+
1443
+ {
1444
+
1445
+ }
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+ |
1454
+ | value |
1455
+
1456
+ Value of selected option for controlled combobox.
1457
+
1458
+ LabelValueMeta
1459
+
1460
+
1461
+
1462
+ | \- | Set object |
1463
+ | watermark |
1464
+
1465
+ |
1466
+
1467
+ true
1468
+
1469
+ | Set object |
1470
+
1471
+ ### Input props
1472
+
1473
+ Autocomplete extends `IressInput`, hence it has the same properties as `IressInput`.
1474
+
1475
+ It does have some defaults to help with user experience. `append` automatically has a search icon, and `clearable` and `watermark` are set to true by default.
1476
+
1477
+ [](./iframe.html?id=components-combobox--input-props)
1478
+
1479
+ None selected
1480
+
1481
+ Hide codedrawOpen in CodeSandbox
1482
+
1483
+ <IressCombobox
1484
+ append\={<IressPopover activator\={<IressButton mode\="tertiary"\><IressIcon name\="cog" /></IressButton\>} align\="bottom-end" container\={document.body}\><IressPanel className\="iress-u-text"\>Some settings in here</IressPanel\></IressPopover\>}
1485
+ options\={\[
1486
+ {
1487
+ label: 'Option 1',
1488
+ value: 1
1489
+ },
1490
+ {
1491
+ label: 'Option 2',
1492
+ value: 2
1493
+ },
1494
+ {
1495
+ label: 'Option 3',
1496
+ value: 3
1497
+ },
1498
+ {
1499
+ label: 'Option 4',
1500
+ value: 4
1501
+ },
1502
+ {
1503
+ label: 'Option 5',
1504
+ value: 5
1505
+ }
1506
+ \]}
1507
+ popoverProps\={{
1508
+ container: {}
1509
+ }}
1510
+ prepend\={<IressIcon name\="search" />}
1511
+ width\="12"
1512
+ />
1513
+
1514
+ ```
1515
+
1516
+ #### Props
1517
+
1518
+ | Name | Description | Default | Control |
1519
+ | --- | --- | --- | --- |
1520
+ | append |
1521
+ object
1522
+
1523
+
1524
+
1525
+ |
1526
+
1527
+ <IressIcon />
1528
+
1529
+ |
1530
+
1531
+ Edit JSON
1532
+
1533
+ append :
1534
+
1535
+ {
1536
+
1537
+ * $$typeof : Symbol(react.transitional.element)
1538
+ * type :
1539
+
1540
+ {...} 5 keys
1541
+
1542
+ * key : null
1543
+ * props :
1544
+
1545
+ {...} 4 keys
1546
+
1547
+ * \_owner : null
1548
+ * \_store :
1549
+
1550
+ {...} 0 keys
1551
+
1552
+
1553
+ }
1554
+
1555
+
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+ |
1562
+ | autoComplete |
1563
+
1564
+ |
1565
+
1566
+ 'off'
1567
+
1568
+ | Set object |
1569
+ | autoSelect |
1570
+
1571
+ |
1572
+
1573
+ true
1574
+
1575
+ | Set object |
1576
+ | clearable |
1577
+
1578
+ |
1579
+
1580
+ true
1581
+
1582
+ | Set object |
1583
+ | defaultValue |
1584
+
1585
+ Value of selected option for uncontrolled combobox.
1586
+
1587
+ LabelValueMeta
1588
+
1589
+
1590
+
1591
+ | \- | Set object |
1592
+ | hiddenInputProps |
1593
+
1594
+ Add additional props to the hidden input.
1595
+
1596
+ Omit
1597
+
1598
+
1599
+
1600
+ | \- | Set object |
1601
+ | limitDesktop |
1602
+
1603
+ |
1604
+
1605
+ 12
1606
+
1607
+ | Set object |
1608
+ | limitMobile |
1609
+
1610
+ |
1611
+
1612
+ 6
1613
+
1614
+ | Set object |
1615
+ | onChange |
1616
+
1617
+ Emitted when the value changes.
1618
+
1619
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1620
+
1621
+ | \- | \- |
1622
+ | options\* |
1623
+
1624
+ Options data set, the available options that the user can select from.
1625
+
1626
+ union
1627
+
1628
+
1629
+
1630
+ | \- |
1631
+
1632
+ Edit JSON
1633
+
1634
+ * options :
1635
+
1636
+ \[
1637
+
1638
+ * 0 :
1639
+
1640
+ {...} 2 keys
1641
+
1642
+ * 1 :
1643
+
1644
+ {...} 2 keys
1645
+
1646
+ * 2 :
1647
+
1648
+ {...} 2 keys
1649
+
1650
+ * 3 :
1651
+
1652
+ {...} 2 keys
1653
+
1654
+ * 4 :
1655
+
1656
+ {...} 2 keys
1657
+
1658
+
1659
+ \]
1660
+
1661
+
1662
+
1663
+
1664
+ |
1665
+ | popoverProps |
1666
+
1667
+ object
1668
+
1669
+
1670
+
1671
+ | { } |
1672
+
1673
+ Edit JSON
1674
+
1675
+ popoverProps :
1676
+
1677
+ {
1678
+
1679
+ }
1680
+
1681
+
1682
+
1683
+
1684
+
1685
+
1686
+
1687
+ |
1688
+ | prepend |
1689
+
1690
+ object
1691
+
1692
+
1693
+
1694
+ | \- |
1695
+
1696
+ Edit JSON
1697
+
1698
+ prepend :
1699
+
1700
+ {
1701
+
1702
+ * $$typeof : Symbol(react.transitional.element)
1703
+ * type :
1704
+
1705
+ {...} 9 keys
1706
+
1707
+ * key : null
1708
+ * props :
1709
+
1710
+ {...} 1 key
1711
+
1712
+ * \_owner : null
1713
+ * \_store :
1714
+
1715
+ {...} 0 keys
1716
+
1717
+
1718
+ }
1719
+
1720
+
1721
+
1722
+
1723
+
1724
+
1725
+
1726
+ |
1727
+ | value |
1728
+
1729
+ Value of selected option for controlled combobox.
1730
+
1731
+ LabelValueMeta
1732
+
1733
+
1734
+
1735
+ | \- | Set object |
1736
+ | watermark |
1737
+
1738
+ |
1739
+
1740
+ true
1741
+
1742
+ | Set object |
1743
+ | width |
1744
+
1745
+ string
1746
+
1747
+
1748
+
1749
+ | \- | 12 |
1750
+
1751
+ ### No results
1752
+
1753
+ If you would like to show a message when there are no results, you can use the `noResultsText` prop. It accepts any React node.
1754
+
1755
+ [](./iframe.html?id=components-combobox--no-results-text)
1756
+
1757
+ None selected
1758
+
1759
+ Hide codedrawOpen in CodeSandbox
1760
+
1761
+ <IressCombobox
1762
+ noResultsText\={<IressPanel className\="iress-u-text"\>No results found</IressPanel\>}
1763
+ options\={\[
1764
+ {
1765
+ label: 'Option 1',
1766
+ value: 1
1767
+ },
1768
+ {
1769
+ label: 'Option 2',
1770
+ value: 2
1771
+ },
1772
+ {
1773
+ label: 'Option 3',
1774
+ value: 3
1775
+ },
1776
+ {
1777
+ label: 'Option 4',
1778
+ value: 4
1779
+ },
1780
+ {
1781
+ label: 'Option 5',
1782
+ value: 5
1783
+ }
1784
+ \]}
1785
+ placeholder\="Type &quot;no&quot; to see the no results text"
1786
+ popoverProps\={{
1787
+ container: {}
1788
+ }}
1789
+ />
1790
+
1791
+ ```
1792
+
1793
+ #### Props
1794
+
1795
+ | Name | Description | Default | Control |
1796
+ | --- | --- | --- | --- |
1797
+ | append |
1798
+ |
1799
+
1800
+ <IressIcon />
1801
+
1802
+ | Set object |
1803
+ | autoComplete |
1804
+
1805
+ |
1806
+
1807
+ 'off'
1808
+
1809
+ | Set object |
1810
+ | autoSelect |
1811
+
1812
+ |
1813
+
1814
+ true
1815
+
1816
+ | Set object |
1817
+ | clearable |
1818
+
1819
+ |
1820
+
1821
+ true
1822
+
1823
+ | Set object |
1824
+ | defaultValue |
1825
+
1826
+ Value of selected option for uncontrolled combobox.
1827
+
1828
+ LabelValueMeta
1829
+
1830
+
1831
+
1832
+ | \- | Set object |
1833
+ | hiddenInputProps |
1834
+
1835
+ Add additional props to the hidden input.
1836
+
1837
+ Omit
1838
+
1839
+
1840
+
1841
+ | \- | Set object |
1842
+ | limitDesktop |
1843
+
1844
+ |
1845
+
1846
+ 12
1847
+
1848
+ | Set object |
1849
+ | limitMobile |
1850
+
1851
+ |
1852
+
1853
+ 6
1854
+
1855
+ | Set object |
1856
+ | noResultsText |
1857
+
1858
+ object
1859
+
1860
+
1861
+
1862
+ | \- |
1863
+
1864
+ Edit JSON
1865
+
1866
+ noResultsText :
1867
+
1868
+ {
1869
+
1870
+ * $$typeof : Symbol(react.transitional.element)
1871
+ * type : ({ children, background = "default", noBorderRadius, noGutter, padding = "md", stretch, textAlign = "inherit", className, ...restProps }) => { const classMap = { \[PanelCssClass.Stretch\]: stretch, \[PanelCssClass.NoBorderRadius\]: noBorderRadius, \[PanelCssClass.NoGutter\]: noGutter }; const cssClasses = classNames( className, PanelCssClass.Base, \`${GlobalCSSClass.TextAlignBase}--${textAlign}\`, \`${PanelCssClass.Background}--${background}\`, getResponsivePaddingClasses(padding), classMap ); return /\* @\_\_PURE\_\_ \*/ jsxDEV("div", { className: cssClasses, ...restProps, children }, void 0, false, { fileName: "/home/runner/work/design-system/design-system/packages/components/src/components/Panel/Panel.tsx", lineNumber: 38, columnNumber: 5 }, this); }
1872
+ * key : null
1873
+ * props :
1874
+
1875
+ {...} 2 keys
1876
+
1877
+ * \_owner : null
1878
+ * \_store :
1879
+
1880
+ {...} 0 keys
1881
+
1882
+
1883
+ }
1884
+
1885
+
1886
+
1887
+
1888
+
1889
+
1890
+
1891
+ |
1892
+ | onChange |
1893
+
1894
+ Emitted when the value changes.
1895
+
1896
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
1897
+
1898
+ | \- | \- |
1899
+ | options\* |
1900
+
1901
+ Options data set, the available options that the user can select from.
1902
+
1903
+ union
1904
+
1905
+
1906
+
1907
+ | \- |
1908
+
1909
+ Edit JSON
1910
+
1911
+ * options :
1912
+
1913
+ \[
1914
+
1915
+ * 0 :
1916
+
1917
+ {...} 2 keys
1918
+
1919
+ * 1 :
1920
+
1921
+ {...} 2 keys
1922
+
1923
+ * 2 :
1924
+
1925
+ {...} 2 keys
1926
+
1927
+ * 3 :
1928
+
1929
+ {...} 2 keys
1930
+
1931
+ * 4 :
1932
+
1933
+ {...} 2 keys
1934
+
1935
+
1936
+ \]
1937
+
1938
+
1939
+
1940
+
1941
+ |
1942
+ | placeholder |
1943
+
1944
+ string
1945
+
1946
+
1947
+
1948
+ | \- | Type "no" to see the no results text |
1949
+ | popoverProps |
1950
+
1951
+ object
1952
+
1953
+
1954
+
1955
+ | { } |
1956
+
1957
+ Edit JSON
1958
+
1959
+ popoverProps :
1960
+
1961
+ {
1962
+
1963
+ }
1964
+
1965
+
1966
+
1967
+
1968
+
1969
+
1970
+
1971
+ |
1972
+ | value |
1973
+
1974
+ Value of selected option for controlled combobox.
1975
+
1976
+ LabelValueMeta
1977
+
1978
+
1979
+
1980
+ | \- | Set object |
1981
+ | watermark |
1982
+
1983
+ |
1984
+
1985
+ true
1986
+
1987
+ | Set object |
1988
+
1989
+ ### Popover props
1990
+
1991
+ Under the hood, autocomplete uses `IressInputPopover` to display the suggestions. It accepts `autoHighlight`, `align`, `className` and `displayMode`.
1992
+
1993
+ There are two additional props that autocomplete accepts to customise the popover: `append` and `prepend`. You can place additional content above or below the results using these props.
1994
+
1995
+ [](./iframe.html?id=components-combobox--popover-props)
1996
+
1997
+ None selected
1998
+
1999
+ Hide codedrawOpen in CodeSandbox
2000
+
2001
+ <IressCombobox
2002
+ options\={\[
2003
+ {
2004
+ label: 'Option 1',
2005
+ value: 1
2006
+ },
2007
+ {
2008
+ label: 'Option 2',
2009
+ value: 2
2010
+ },
2011
+ {
2012
+ label: 'Option 3',
2013
+ value: 3
2014
+ },
2015
+ {
2016
+ label: 'Option 4',
2017
+ value: 4
2018
+ },
2019
+ {
2020
+ label: 'Option 5',
2021
+ value: 5
2022
+ }
2023
+ \]}
2024
+ popoverProps\={{
2025
+ append: <IressPanel\><IressButton\>Add an option</IressButton\></IressPanel\>,
2026
+ container: {}
2027
+ }}
2028
+ />
2029
+
2030
+ ```
2031
+
2032
+ #### Props
2033
+
2034
+ | Name | Description | Default | Control |
2035
+ | --- | --- | --- | --- |
2036
+ | append |
2037
+ |
2038
+
2039
+ <IressIcon />
2040
+
2041
+ | Set object |
2042
+ | autoComplete |
2043
+
2044
+ |
2045
+
2046
+ 'off'
2047
+
2048
+ | Set object |
2049
+ | autoSelect |
2050
+
2051
+ |
2052
+
2053
+ true
2054
+
2055
+ | Set object |
2056
+ | clearable |
2057
+
2058
+ |
2059
+
2060
+ true
2061
+
2062
+ | Set object |
2063
+ | defaultValue |
2064
+
2065
+ Value of selected option for uncontrolled combobox.
2066
+
2067
+ LabelValueMeta
2068
+
2069
+
2070
+
2071
+ | \- | Set object |
2072
+ | hiddenInputProps |
2073
+
2074
+ Add additional props to the hidden input.
2075
+
2076
+ Omit
2077
+
2078
+
2079
+
2080
+ | \- | Set object |
2081
+ | limitDesktop |
2082
+
2083
+ |
2084
+
2085
+ 12
2086
+
2087
+ | Set object |
2088
+ | limitMobile |
2089
+
2090
+ |
2091
+
2092
+ 6
2093
+
2094
+ | Set object |
2095
+ | onChange |
2096
+
2097
+ Emitted when the value changes.
2098
+
2099
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2100
+
2101
+ | \- | \- |
2102
+ | options\* |
2103
+
2104
+ Options data set, the available options that the user can select from.
2105
+
2106
+ union
2107
+
2108
+
2109
+
2110
+ | \- |
2111
+
2112
+ Edit JSON
2113
+
2114
+ * options :
2115
+
2116
+ \[
2117
+
2118
+ * 0 :
2119
+
2120
+ {...} 2 keys
2121
+
2122
+ * 1 :
2123
+
2124
+ {...} 2 keys
2125
+
2126
+ * 2 :
2127
+
2128
+ {...} 2 keys
2129
+
2130
+ * 3 :
2131
+
2132
+ {...} 2 keys
2133
+
2134
+ * 4 :
2135
+
2136
+ {...} 2 keys
2137
+
2138
+
2139
+ \]
2140
+
2141
+
2142
+
2143
+
2144
+ |
2145
+ | popoverProps |
2146
+
2147
+ object
2148
+
2149
+
2150
+
2151
+ | { } |
2152
+
2153
+ Edit JSON
2154
+
2155
+ popoverProps :
2156
+
2157
+ {
2158
+
2159
+ * append :
2160
+
2161
+ {...} 6 keys
2162
+
2163
+
2164
+ }
2165
+
2166
+
2167
+
2168
+
2169
+
2170
+
2171
+
2172
+ |
2173
+ | value |
2174
+
2175
+ Value of selected option for controlled combobox.
2176
+
2177
+ LabelValueMeta
2178
+
2179
+
2180
+
2181
+ | \- | Set object |
2182
+ | watermark |
2183
+
2184
+ |
2185
+
2186
+ true
2187
+
2188
+ | Set object |
2189
+
2190
+ ### Debounce threshold
2191
+
2192
+ The `debounceThreshold` prop can be used to set the time in milliseconds to wait before making a request to the `options` function. This is useful when you want to prevent making too many requests to the server.
2193
+
2194
+ By default there is a debounce of `500`ms, but it can be removed by setting it to `0`.
2195
+
2196
+ **Note:** Removing the debounce and keeping `autoSelect` true may cause some weird highlighting issues if the user types quickly.
2197
+
2198
+ [](./iframe.html?id=components-combobox--debounce-threshold)
2199
+
2200
+ None selected
2201
+
2202
+ Hide codedrawOpen in CodeSandbox
2203
+
2204
+ <IressCombobox
2205
+ debounceThreshold\={0}
2206
+ options\={\[
2207
+ {
2208
+ label: 'Option 1',
2209
+ value: 1
2210
+ },
2211
+ {
2212
+ label: 'Option 2',
2213
+ value: 2
2214
+ },
2215
+ {
2216
+ label: 'Option 3',
2217
+ value: 3
2218
+ },
2219
+ {
2220
+ label: 'Option 4',
2221
+ value: 4
2222
+ },
2223
+ {
2224
+ label: 'Option 5',
2225
+ value: 5
2226
+ }
2227
+ \]}
2228
+ placeholder\="Instant search!"
2229
+ popoverProps\={{
2230
+ container: {}
2231
+ }}
2232
+ />
2233
+
2234
+ ```
2235
+
2236
+ #### Props
2237
+
2238
+ | Name | Description | Default | Control |
2239
+ | --- | --- | --- | --- |
2240
+ | append |
2241
+ |
2242
+
2243
+ <IressIcon />
2244
+
2245
+ | Set object |
2246
+ | autoComplete |
2247
+
2248
+ |
2249
+
2250
+ 'off'
2251
+
2252
+ | Set object |
2253
+ | autoSelect |
2254
+
2255
+ |
2256
+
2257
+ true
2258
+
2259
+ | Set object |
2260
+ | clearable |
2261
+
2262
+ |
2263
+
2264
+ true
2265
+
2266
+ | Set object |
2267
+ | debounceThreshold |
2268
+
2269
+ number
2270
+
2271
+
2272
+
2273
+ | \- | |
2274
+ | defaultValue |
2275
+
2276
+ Value of selected option for uncontrolled combobox.
2277
+
2278
+ LabelValueMeta
2279
+
2280
+
2281
+
2282
+ | \- | Set object |
2283
+ | hiddenInputProps |
2284
+
2285
+ Add additional props to the hidden input.
2286
+
2287
+ Omit
2288
+
2289
+
2290
+
2291
+ | \- | Set object |
2292
+ | limitDesktop |
2293
+
2294
+ |
2295
+
2296
+ 12
2297
+
2298
+ | Set object |
2299
+ | limitMobile |
2300
+
2301
+ |
2302
+
2303
+ 6
2304
+
2305
+ | Set object |
2306
+ | onChange |
2307
+
2308
+ Emitted when the value changes.
2309
+
2310
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2311
+
2312
+ | \- | \- |
2313
+ | options\* |
2314
+
2315
+ Options data set, the available options that the user can select from.
2316
+
2317
+ union
2318
+
2319
+
2320
+
2321
+ | \- |
2322
+
2323
+ Edit JSON
2324
+
2325
+ * options :
2326
+
2327
+ \[
2328
+
2329
+ * 0 :
2330
+
2331
+ {...} 2 keys
2332
+
2333
+ * 1 :
2334
+
2335
+ {...} 2 keys
2336
+
2337
+ * 2 :
2338
+
2339
+ {...} 2 keys
2340
+
2341
+ * 3 :
2342
+
2343
+ {...} 2 keys
2344
+
2345
+ * 4 :
2346
+
2347
+ {...} 2 keys
2348
+
2349
+
2350
+ \]
2351
+
2352
+
2353
+
2354
+
2355
+ |
2356
+ | placeholder |
2357
+
2358
+ string
2359
+
2360
+
2361
+
2362
+ | \- | Instant search! |
2363
+ | popoverProps |
2364
+
2365
+ object
2366
+
2367
+
2368
+
2369
+ | { } |
2370
+
2371
+ Edit JSON
2372
+
2373
+ popoverProps :
2374
+
2375
+ {
2376
+
2377
+ }
2378
+
2379
+
2380
+
2381
+
2382
+
2383
+
2384
+
2385
+ |
2386
+ | value |
2387
+
2388
+ Value of selected option for controlled combobox.
2389
+
2390
+ LabelValueMeta
2391
+
2392
+
2393
+
2394
+ | \- | Set object |
2395
+ | watermark |
2396
+
2397
+ |
2398
+
2399
+ true
2400
+
2401
+ | Set object |
2402
+
2403
+ ### Result limits
2404
+
2405
+ You can limit the maximum amount of search results displayed in the suggestions by setting the `limitDesktop` prop. This defaults to 12.
2406
+
2407
+ On smaller screens (< 768px), the number of options is further reduced by using the `limitMobile` prop, which defaults to 6.
2408
+
2409
+ `limitMobile` works by filtering the search results that have been filtered by `limitDesktop`, so must be a smaller value. For example:
2410
+
2411
+ // 12 results on large screens, 6 on small screens (default values)
2412
+ <IressCombobox options\={...} />
2413
+ // 4 results on large screens, 3 on small screens
2414
+ <IressCombobox limitDesktop\={4} limitMobile\={3} options\={...} />
2415
+ // 4 results on all screens (resultLimitMobile > resultLimitDesktop so has no effect)
2416
+ <IressCombobox limitDesktop\={4} limitMobile\={5} options\={...} />
2417
+
2418
+ ```
2419
+
2420
+ The result limits will also affect the number of initial options displayed, if the `initialOptions` prop is set.
2421
+
2422
+ [](./iframe.html?id=components-combobox--result-limits)
2423
+
2424
+ **xl** breakpoint (1200px - 1499px)
2425
+
2426
+ None selected
2427
+
2428
+ Hide codedrawOpen in CodeSandbox
2429
+
2430
+ <IressStack gutter\="md"\>
2431
+ <IressPanel className\="iress-u-text"\>
2432
+ <Ln />
2433
+ </IressPanel\>
2434
+ <IressCombobox
2435
+ limitDesktop\={6}
2436
+ limitMobile\={3}
2437
+ options\={\[
2438
+ {
2439
+ label: 'Option 1'
2440
+ },
2441
+ {
2442
+ label: 'Option 2'
2443
+ },
2444
+ {
2445
+ label: 'Option 3'
2446
+ },
2447
+ {
2448
+ label: 'Option 4'
2449
+ },
2450
+ {
2451
+ label: 'Option 5'
2452
+ },
2453
+ {
2454
+ label: 'Option 6'
2455
+ },
2456
+ {
2457
+ label: 'Option 7'
2458
+ },
2459
+ {
2460
+ label: 'Option 8'
2461
+ },
2462
+ {
2463
+ label: 'Option 9'
2464
+ },
2465
+ {
2466
+ label: 'Option 10'
2467
+ },
2468
+ {
2469
+ label: 'Option 11'
2470
+ },
2471
+ {
2472
+ label: 'Option 12'
2473
+ },
2474
+ {
2475
+ label: 'Option 13'
2476
+ },
2477
+ {
2478
+ label: 'Option 14'
2479
+ },
2480
+ {
2481
+ label: 'Option 15'
2482
+ }
2483
+ \]}
2484
+ popoverProps\={{
2485
+ container: {}
2486
+ }}
2487
+ />
2488
+ </IressStack\>
2489
+
2490
+ ```
2491
+
2492
+ #### Props
2493
+
2494
+ | Name | Description | Default | Control |
2495
+ | --- | --- | --- | --- |
2496
+ | append |
2497
+ |
2498
+
2499
+ <IressIcon />
2500
+
2501
+ | Set object |
2502
+ | autoComplete |
2503
+
2504
+ |
2505
+
2506
+ 'off'
2507
+
2508
+ | Set object |
2509
+ | autoSelect |
2510
+
2511
+ |
2512
+
2513
+ true
2514
+
2515
+ | Set object |
2516
+ | clearable |
2517
+
2518
+ |
2519
+
2520
+ true
2521
+
2522
+ | Set object |
2523
+ | defaultValue |
2524
+
2525
+ Value of selected option for uncontrolled combobox.
2526
+
2527
+ LabelValueMeta
2528
+
2529
+
2530
+
2531
+ | \- | Set object |
2532
+ | hiddenInputProps |
2533
+
2534
+ Add additional props to the hidden input.
2535
+
2536
+ Omit
2537
+
2538
+
2539
+
2540
+ | \- | Set object |
2541
+ | limitDesktop |
2542
+
2543
+ number
2544
+
2545
+
2546
+
2547
+ |
2548
+
2549
+ 12
2550
+
2551
+ | |
2552
+ | limitMobile |
2553
+
2554
+ number
2555
+
2556
+
2557
+
2558
+ |
2559
+
2560
+ 6
2561
+
2562
+ | |
2563
+ | onChange |
2564
+
2565
+ Emitted when the value changes.
2566
+
2567
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2568
+
2569
+ | \- | \- |
2570
+ | options\* |
2571
+
2572
+ Options data set, the available options that the user can select from.
2573
+
2574
+ union
2575
+
2576
+
2577
+
2578
+ | \- |
2579
+
2580
+ Edit JSON
2581
+
2582
+ * options :
2583
+
2584
+ \[
2585
+
2586
+ * 0 :
2587
+
2588
+ {...} 1 key
2589
+
2590
+ * 1 :
2591
+
2592
+ {...} 1 key
2593
+
2594
+ * 2 :
2595
+
2596
+ {...} 1 key
2597
+
2598
+ * 3 :
2599
+
2600
+ {...} 1 key
2601
+
2602
+ * 4 :
2603
+
2604
+ {...} 1 key
2605
+
2606
+ * 5 :
2607
+
2608
+ {...} 1 key
2609
+
2610
+ * 6 :
2611
+
2612
+ {...} 1 key
2613
+
2614
+ * 7 :
2615
+
2616
+ {...} 1 key
2617
+
2618
+ * 8 :
2619
+
2620
+ {...} 1 key
2621
+
2622
+ * 9 :
2623
+
2624
+ {...} 1 key
2625
+
2626
+ * 10 :
2627
+
2628
+ {...} 1 key
2629
+
2630
+ * 11 :
2631
+
2632
+ {...} 1 key
2633
+
2634
+ * 12 :
2635
+
2636
+ {...} 1 key
2637
+
2638
+ * 13 :
2639
+
2640
+ {...} 1 key
2641
+
2642
+ * 14 :
2643
+
2644
+ {...} 1 key
2645
+
2646
+
2647
+ \]
2648
+
2649
+
2650
+
2651
+
2652
+ |
2653
+ | popoverProps |
2654
+
2655
+ object
2656
+
2657
+
2658
+
2659
+ | { } |
2660
+
2661
+ Edit JSON
2662
+
2663
+ popoverProps :
2664
+
2665
+ {
2666
+
2667
+ }
2668
+
2669
+
2670
+
2671
+
2672
+
2673
+
2674
+
2675
+ |
2676
+ | value |
2677
+
2678
+ Value of selected option for controlled combobox.
2679
+
2680
+ LabelValueMeta
2681
+
2682
+
2683
+
2684
+ | \- | Set object |
2685
+ | watermark |
2686
+
2687
+ |
2688
+
2689
+ true
2690
+
2691
+ | Set object |
2692
+
2693
+ ### Readonly
2694
+
2695
+ The `readOnly` prop can be set to prevent the user from changing the value of the autocomplete. This will change the input to a custom read-only style and the user will not be able to interact with the input.
2696
+
2697
+ If you need more control over the read-only state (for example, rendering a stylised version of the value), you can use the [`IressReadonly` component](?path=/docs/components-readonly--docs).
2698
+
2699
+ [](./iframe.html?id=components-combobox--readonly)
2700
+
2701
+ Option 1
2702
+
2703
+ Hide codedrawOpen in CodeSandbox
2704
+
2705
+ <IressCombobox
2706
+ defaultValue\={{
2707
+ label: 'Option 1',
2708
+ value: 1
2709
+ }}
2710
+ options\={\[
2711
+ {
2712
+ label: 'Option 1',
2713
+ value: 1
2714
+ },
2715
+ {
2716
+ label: 'Option 2',
2717
+ value: 2
2718
+ },
2719
+ {
2720
+ label: 'Option 3',
2721
+ value: 3
2722
+ },
2723
+ {
2724
+ label: 'Option 4',
2725
+ value: 4
2726
+ },
2727
+ {
2728
+ label: 'Option 5',
2729
+ value: 5
2730
+ }
2731
+ \]}
2732
+ popoverProps\={{
2733
+ container: {}
2734
+ }}
2735
+ readOnly
2736
+ />
2737
+
2738
+ ```
2739
+
2740
+ #### Props
2741
+
2742
+ | Name | Description | Default | Control |
2743
+ | --- | --- | --- | --- |
2744
+ | append |
2745
+ |
2746
+
2747
+ <IressIcon />
2748
+
2749
+ | Set object |
2750
+ | autoComplete |
2751
+
2752
+ |
2753
+
2754
+ 'off'
2755
+
2756
+ | Set object |
2757
+ | autoSelect |
2758
+
2759
+ |
2760
+
2761
+ true
2762
+
2763
+ | Set object |
2764
+ | clearable |
2765
+
2766
+ |
2767
+
2768
+ true
2769
+
2770
+ | Set object |
2771
+ | defaultValue |
2772
+
2773
+ Value of selected option for uncontrolled combobox.
2774
+
2775
+ LabelValueMeta
2776
+
2777
+
2778
+
2779
+ | \- |
2780
+
2781
+ Edit JSON
2782
+
2783
+ defaultValue :
2784
+
2785
+ {
2786
+
2787
+ * label : "Option 1"
2788
+ * value : 1
2789
+
2790
+ }
2791
+
2792
+
2793
+
2794
+
2795
+
2796
+
2797
+
2798
+ |
2799
+ | hiddenInputProps |
2800
+
2801
+ Add additional props to the hidden input.
2802
+
2803
+ Omit
2804
+
2805
+
2806
+
2807
+ | \- | Set object |
2808
+ | limitDesktop |
2809
+
2810
+ |
2811
+
2812
+ 12
2813
+
2814
+ | Set object |
2815
+ | limitMobile |
2816
+
2817
+ |
2818
+
2819
+ 6
2820
+
2821
+ | Set object |
2822
+ | onChange |
2823
+
2824
+ Emitted when the value changes.
2825
+
2826
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta, ) => void
2827
+
2828
+ | \- | \- |
2829
+ | options\* |
2830
+
2831
+ Options data set, the available options that the user can select from.
2832
+
2833
+ union
2834
+
2835
+
2836
+
2837
+ | \- |
2838
+
2839
+ Edit JSON
2840
+
2841
+ * options :
2842
+
2843
+ \[
2844
+
2845
+ * 0 :
2846
+
2847
+ {...} 2 keys
2848
+
2849
+ * 1 :
2850
+
2851
+ {...} 2 keys
2852
+
2853
+ * 2 :
2854
+
2855
+ {...} 2 keys
2856
+
2857
+ * 3 :
2858
+
2859
+ {...} 2 keys
2860
+
2861
+ * 4 :
2862
+
2863
+ {...} 2 keys
2864
+
2865
+
2866
+ \]
2867
+
2868
+
2869
+
2870
+
2871
+ |
2872
+ | popoverProps |
2873
+
2874
+ object
2875
+
2876
+
2877
+
2878
+ | { } |
2879
+
2880
+ Edit JSON
2881
+
2882
+ popoverProps :
2883
+
2884
+ {
2885
+
2886
+ }
2887
+
2888
+
2889
+
2890
+
2891
+
2892
+
2893
+
2894
+ |
2895
+ | readOnly |
2896
+
2897
+ boolean
2898
+
2899
+
2900
+
2901
+ | \- | FalseTrue |
2902
+ | value |
2903
+
2904
+ Value of selected option for controlled combobox.
2905
+
2906
+ LabelValueMeta
2907
+
2908
+
2909
+
2910
+ | \- | Set object |
2911
+ | watermark |
2912
+
2913
+ |
2914
+
2915
+ true
2916
+
2917
+ | Set object |
2918
+
2919
+ `IressMultiCombobox`
2920
+ --------------------
2921
+
2922
+ `IressMultiCombobox` is a multi-select version of `IressCombobox`. It allows the user to select multiple options from a list. The selected items will be displayed as tags, as well as within the popover.
2923
+
2924
+ * * *
2925
+
2926
+ Caution
2927
+
2928
+ **Use IressRichSelect instead**
2929
+
2930
+ The design of this component is changing. Please use the new component/props instead.
2931
+
2932
+ [](./iframe.html?id=components-combobox-multicombobox--options)
2933
+
2934
+ None selected
2935
+
2936
+ Hide codedrawOpen in CodeSandbox
2937
+
2938
+ <IressMultiCombobox
2939
+ options\={\[
2940
+ {
2941
+ label: 'Option 1',
2942
+ value: 1
2943
+ },
2944
+ {
2945
+ label: 'Option 2',
2946
+ value: 2
2947
+ },
2948
+ {
2949
+ label: 'Option 3',
2950
+ value: 3
2951
+ },
2952
+ {
2953
+ label: 'Option 4',
2954
+ value: 4
2955
+ },
2956
+ {
2957
+ label: 'Option 5',
2958
+ value: 5
2959
+ }
2960
+ \]}
2961
+ popoverProps\={{
2962
+ container: {}
2963
+ }}
2964
+ />
2965
+
2966
+ ```
2967
+
2968
+ #### Props
2969
+
2970
+ | Name | Description | Default | Control |
2971
+ | --- | --- | --- | --- |
2972
+ | append |
2973
+ |
2974
+
2975
+ <IressIcon />
2976
+
2977
+ | Set object |
2978
+ | autoComplete |
2979
+
2980
+ |
2981
+
2982
+ 'off'
2983
+
2984
+ | Set object |
2985
+ | autoSelect |
2986
+
2987
+ |
2988
+
2989
+ true
2990
+
2991
+ | Set object |
2992
+ | clearable |
2993
+
2994
+ |
2995
+
2996
+ true
2997
+
2998
+ | Set object |
2999
+ | defaultValue |
3000
+
3001
+ Value of selected option for uncontrolled combobox.
3002
+
3003
+ LabelValueMeta\[\]
3004
+
3005
+ | \- | Set object |
3006
+ | limitDesktop |
3007
+
3008
+ |
3009
+
3010
+ 12
3011
+
3012
+ | Set object |
3013
+ | limitMobile |
3014
+
3015
+ |
3016
+
3017
+ 6
3018
+
3019
+ | Set object |
3020
+ | multiOptionTagLimit |
3021
+
3022
+ The number of select options before the view switches to a single aggregate tag.
3023
+
3024
+ number
3025
+
3026
+
3027
+
3028
+ |
3029
+
3030
+ 4
3031
+
3032
+ | Set number |
3033
+ | onChange |
3034
+
3035
+ Emitted when the value changes.
3036
+
3037
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta\[\], ) => void
3038
+
3039
+ | \- | \- |
3040
+ | options |
3041
+
3042
+ array
3043
+
3044
+
3045
+
3046
+ | \- |
3047
+
3048
+ Edit JSON
3049
+
3050
+ * options :
3051
+
3052
+ \[
3053
+
3054
+ * 0 :
3055
+
3056
+ {...} 2 keys
3057
+
3058
+ * 1 :
3059
+
3060
+ {...} 2 keys
3061
+
3062
+ * 2 :
3063
+
3064
+ {...} 2 keys
3065
+
3066
+ * 3 :
3067
+
3068
+ {...} 2 keys
3069
+
3070
+ * 4 :
3071
+
3072
+ {...} 2 keys
3073
+
3074
+
3075
+ \]
3076
+
3077
+
3078
+
3079
+
3080
+ |
3081
+ | popoverProps |
3082
+
3083
+ object
3084
+
3085
+
3086
+
3087
+ | { } |
3088
+
3089
+ Edit JSON
3090
+
3091
+ popoverProps :
3092
+
3093
+ {
3094
+
3095
+ }
3096
+
3097
+
3098
+
3099
+
3100
+
3101
+
3102
+
3103
+ |
3104
+ | selectedOptionsTagText |
3105
+
3106
+ Text displayed next to tag count in tag when tag limit is exceeded.
3107
+
3108
+ string
3109
+
3110
+
3111
+
3112
+ |
3113
+
3114
+ 'options selected'
3115
+
3116
+ | Set string |
3117
+ | type |
3118
+
3119
+ |
3120
+
3121
+ 'search'
3122
+
3123
+ | Set object |
3124
+ | value |
3125
+
3126
+ Value of selected option for controlled combobox.
3127
+
3128
+ LabelValueMeta\[\]
3129
+
3130
+ | \- | Set object |
3131
+ | watermark |
3132
+
3133
+ |
3134
+
3135
+ true
3136
+
3137
+ | Set object |
3138
+
3139
+ ### Tag limit
3140
+
3141
+ When combobox is in multi-select mode and the number of selected options exceeds the `multiOptionTagLimit` (`4` by default), the view will switch from a collection of tags to a single aggregate tag with a count of the number of selected options.
3142
+
3143
+ The text displayed in the single tag can be modified using the `selectedOptionsTagText` prop (it is set to `options selected` by default).
3144
+
3145
+ [](./iframe.html?id=components-combobox-multicombobox--tag-limit)
3146
+
3147
+ 3 options selected
3148
+
3149
+ None selected
3150
+
3151
+ Hide codedrawOpen in CodeSandbox
3152
+
3153
+ <IressMultiCombobox
3154
+ defaultValue\={\[
3155
+ {
3156
+ label: 'Option 1',
3157
+ value: 1
3158
+ },
3159
+ {
3160
+ label: 'Option 2',
3161
+ value: 2
3162
+ },
3163
+ {
3164
+ label: 'Option 3',
3165
+ value: 3
3166
+ }
3167
+ \]}
3168
+ multiOptionTagLimit\={2}
3169
+ options\={\[
3170
+ {
3171
+ label: 'Option 1',
3172
+ value: 1
3173
+ },
3174
+ {
3175
+ label: 'Option 2',
3176
+ value: 2
3177
+ },
3178
+ {
3179
+ label: 'Option 3',
3180
+ value: 3
3181
+ },
3182
+ {
3183
+ label: 'Option 4',
3184
+ value: 4
3185
+ },
3186
+ {
3187
+ label: 'Option 5',
3188
+ value: 5
3189
+ }
3190
+ \]}
3191
+ popoverProps\={{
3192
+ container: {}
3193
+ }}
3194
+ selectedOptionsTagText\="options selected"
3195
+ />
3196
+
3197
+ ```
3198
+
3199
+ #### Props
3200
+
3201
+ | Name | Description | Default | Control |
3202
+ | --- | --- | --- | --- |
3203
+ | append |
3204
+ |
3205
+
3206
+ <IressIcon />
3207
+
3208
+ | Set object |
3209
+ | autoComplete |
3210
+
3211
+ |
3212
+
3213
+ 'off'
3214
+
3215
+ | Set object |
3216
+ | autoSelect |
3217
+
3218
+ |
3219
+
3220
+ true
3221
+
3222
+ | Set object |
3223
+ | clearable |
3224
+
3225
+ |
3226
+
3227
+ true
3228
+
3229
+ | Set object |
3230
+ | defaultValue |
3231
+
3232
+ Value of selected option for uncontrolled combobox.
3233
+
3234
+ LabelValueMeta\[\]
3235
+
3236
+ | \- |
3237
+
3238
+ Edit JSON
3239
+
3240
+ * defaultValue :
3241
+
3242
+ \[
3243
+
3244
+ * 0 :
3245
+
3246
+ {...} 2 keys
3247
+
3248
+ * 1 :
3249
+
3250
+ {...} 2 keys
3251
+
3252
+ * 2 :
3253
+
3254
+ {...} 2 keys
3255
+
3256
+
3257
+ \]
3258
+
3259
+
3260
+
3261
+
3262
+ |
3263
+ | limitDesktop |
3264
+
3265
+ |
3266
+
3267
+ 12
3268
+
3269
+ | Set object |
3270
+ | limitMobile |
3271
+
3272
+ |
3273
+
3274
+ 6
3275
+
3276
+ | Set object |
3277
+ | multiOptionTagLimit |
3278
+
3279
+ The number of select options before the view switches to a single aggregate tag.
3280
+
3281
+ number
3282
+
3283
+
3284
+
3285
+ |
3286
+
3287
+ 4
3288
+
3289
+ | |
3290
+ | onChange |
3291
+
3292
+ Emitted when the value changes.
3293
+
3294
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta\[\], ) => void
3295
+
3296
+ | \- | \- |
3297
+ | options |
3298
+
3299
+ array
3300
+
3301
+
3302
+
3303
+ | \- |
3304
+
3305
+ Edit JSON
3306
+
3307
+ * options :
3308
+
3309
+ \[
3310
+
3311
+ * 0 :
3312
+
3313
+ {...} 2 keys
3314
+
3315
+ * 1 :
3316
+
3317
+ {...} 2 keys
3318
+
3319
+ * 2 :
3320
+
3321
+ {...} 2 keys
3322
+
3323
+ * 3 :
3324
+
3325
+ {...} 2 keys
3326
+
3327
+ * 4 :
3328
+
3329
+ {...} 2 keys
3330
+
3331
+
3332
+ \]
3333
+
3334
+
3335
+
3336
+
3337
+ |
3338
+ | popoverProps |
3339
+
3340
+ object
3341
+
3342
+
3343
+
3344
+ | { } |
3345
+
3346
+ Edit JSON
3347
+
3348
+ popoverProps :
3349
+
3350
+ {
3351
+
3352
+ }
3353
+
3354
+
3355
+
3356
+
3357
+
3358
+
3359
+
3360
+ |
3361
+ | selectedOptionsTagText |
3362
+
3363
+ Text displayed next to tag count in tag when tag limit is exceeded.
3364
+
3365
+ string
3366
+
3367
+
3368
+
3369
+ |
3370
+
3371
+ 'options selected'
3372
+
3373
+ | options selected |
3374
+ | type |
3375
+
3376
+ |
3377
+
3378
+ 'search'
3379
+
3380
+ | Set object |
3381
+ | value |
3382
+
3383
+ Value of selected option for controlled combobox.
3384
+
3385
+ LabelValueMeta\[\]
3386
+
3387
+ | \- | Set object |
3388
+ | watermark |
3389
+
3390
+ |
3391
+
3392
+ true
3393
+
3394
+ | Set object |
3395
+
3396
+ ### Readonly
3397
+
3398
+ The `readOnly` prop can be set to prevent the user from changing the value of the multi-combobox. This will change the input to a custom read-only style and the user will not be able to interact with the input. Multiple values are seperated by a comma.
3399
+
3400
+ If you need more control over the read-only state (for example, rendering a stylised version of the value), you can use the [`IressReadonly` component](?path=/docs/components-readonly--docs).
3401
+
3402
+ [](./iframe.html?id=components-combobox-multicombobox--readonly)
3403
+
3404
+ Option 1, Option 2, Option 3
3405
+
3406
+ Hide codedrawOpen in CodeSandbox
3407
+
3408
+ <IressMultiCombobox
3409
+ defaultValue\={\[
3410
+ {
3411
+ label: 'Option 1',
3412
+ value: 1
3413
+ },
3414
+ {
3415
+ label: 'Option 2',
3416
+ value: 2
3417
+ },
3418
+ {
3419
+ label: 'Option 3',
3420
+ value: 3
3421
+ }
3422
+ \]}
3423
+ options\={\[
3424
+ {
3425
+ label: 'Option 1',
3426
+ value: 1
3427
+ },
3428
+ {
3429
+ label: 'Option 2',
3430
+ value: 2
3431
+ },
3432
+ {
3433
+ label: 'Option 3',
3434
+ value: 3
3435
+ },
3436
+ {
3437
+ label: 'Option 4',
3438
+ value: 4
3439
+ },
3440
+ {
3441
+ label: 'Option 5',
3442
+ value: 5
3443
+ }
3444
+ \]}
3445
+ popoverProps\={{
3446
+ container: {}
3447
+ }}
3448
+ readOnly
3449
+ />
3450
+
3451
+ ```
3452
+
3453
+ #### Props
3454
+
3455
+ | Name | Description | Default | Control |
3456
+ | --- | --- | --- | --- |
3457
+ | append |
3458
+ |
3459
+
3460
+ <IressIcon />
3461
+
3462
+ | Set object |
3463
+ | autoComplete |
3464
+
3465
+ |
3466
+
3467
+ 'off'
3468
+
3469
+ | Set object |
3470
+ | autoSelect |
3471
+
3472
+ |
3473
+
3474
+ true
3475
+
3476
+ | Set object |
3477
+ | clearable |
3478
+
3479
+ |
3480
+
3481
+ true
3482
+
3483
+ | Set object |
3484
+ | defaultValue |
3485
+
3486
+ Value of selected option for uncontrolled combobox.
3487
+
3488
+ LabelValueMeta\[\]
3489
+
3490
+ | \- |
3491
+
3492
+ Edit JSON
3493
+
3494
+ * defaultValue :
3495
+
3496
+ \[
3497
+
3498
+ * 0 :
3499
+
3500
+ {...} 2 keys
3501
+
3502
+ * 1 :
3503
+
3504
+ {...} 2 keys
3505
+
3506
+ * 2 :
3507
+
3508
+ {...} 2 keys
3509
+
3510
+
3511
+ \]
3512
+
3513
+
3514
+
3515
+
3516
+ |
3517
+ | limitDesktop |
3518
+
3519
+ |
3520
+
3521
+ 12
3522
+
3523
+ | Set object |
3524
+ | limitMobile |
3525
+
3526
+ |
3527
+
3528
+ 6
3529
+
3530
+ | Set object |
3531
+ | multiOptionTagLimit |
3532
+
3533
+ The number of select options before the view switches to a single aggregate tag.
3534
+
3535
+ number
3536
+
3537
+
3538
+
3539
+ |
3540
+
3541
+ 4
3542
+
3543
+ | Set number |
3544
+ | onChange |
3545
+
3546
+ Emitted when the value changes.
3547
+
3548
+ ( e?: SyntheticEvent<InputBaseElement>, value?: LabelValueMeta\[\], ) => void
3549
+
3550
+ | \- | \- |
3551
+ | options |
3552
+
3553
+ array
3554
+
3555
+
3556
+
3557
+ | \- |
3558
+
3559
+ Edit JSON
3560
+
3561
+ * options :
3562
+
3563
+ \[
3564
+
3565
+ * 0 :
3566
+
3567
+ {...} 2 keys
3568
+
3569
+ * 1 :
3570
+
3571
+ {...} 2 keys
3572
+
3573
+ * 2 :
3574
+
3575
+ {...} 2 keys
3576
+
3577
+ * 3 :
3578
+
3579
+ {...} 2 keys
3580
+
3581
+ * 4 :
3582
+
3583
+ {...} 2 keys
3584
+
3585
+
3586
+ \]
3587
+
3588
+
3589
+
3590
+
3591
+ |
3592
+ | popoverProps |
3593
+
3594
+ object
3595
+
3596
+
3597
+
3598
+ | { } |
3599
+
3600
+ Edit JSON
3601
+
3602
+ popoverProps :
3603
+
3604
+ {
3605
+
3606
+ }
3607
+
3608
+
3609
+
3610
+
3611
+
3612
+
3613
+
3614
+ |
3615
+ | readOnly |
3616
+
3617
+ boolean
3618
+
3619
+
3620
+
3621
+ | \- | FalseTrue |
3622
+ | selectedOptionsTagText |
3623
+
3624
+ Text displayed next to tag count in tag when tag limit is exceeded.
3625
+
3626
+ string
3627
+
3628
+
3629
+
3630
+ |
3631
+
3632
+ 'options selected'
3633
+
3634
+ | Set string |
3635
+ | type |
3636
+
3637
+ |
3638
+
3639
+ 'search'
3640
+
3641
+ | Set object |
3642
+ | value |
3643
+
3644
+ Value of selected option for controlled combobox.
3645
+
3646
+ LabelValueMeta\[\]
3647
+
3648
+ | \- | Set object |
3649
+ | watermark |
3650
+
3651
+ |
3652
+
3653
+ true
3654
+
3655
+ | Set object |
3656
+
3657
+ Testing
3658
+ -------
3659
+
3660
+ To help you effectively test the combobox component, we have provided a few tips based on the behaviour of the component and our own experience.
3661
+
3662
+ **Note:** These are suggestions and not requirements. You should test the component in a way that best suits your use case.
3663
+
3664
+ ### Partial query matching
3665
+
3666
+ The suggestions are filtered based on the input value. If the input value only matches a part of the option, the input value is highlighted by a `<b />` tag in each option. You will need to account for this in your tests, either using an exact string match with a space to denote the highlighted value, or using a regex to match the string.
3667
+
3668
+ If you are using `meta`, `prepend` or `append` props in `LabelValueMeta`, you should also consider this in your search query for the option.
3669
+
3670
+ render(
3671
+ <IressCombobox
3672
+ options\={\[
3673
+ { label: 'Luke Skywalker', value: 'Luke Skywalker', meta: 'male' },
3674
+ \]}
3675
+ />,
3676
+ );
3677
+ const autocomplete \= screen.getByRole('combobox');
3678
+ await user.type(autocomplete, 'lu');
3679
+ // Exact string match with a space to denote the highlighted value
3680
+ const option \= await screen.findByRole('option', {
3681
+ name: 'Lu ke Skywalker male',
3682
+ });
3683
+ expect(option).toBeInTheDocument();
3684
+ // Using a regex to match the string
3685
+ const option \= await screen.findByRole('option', { name: /Skywalker/ });
3686
+ expect(option).toBeInTheDocument();
3687
+
3688
+ ```
3689
+
3690
+ ### Query for minimal characters
3691
+
3692
+ If you are testing if a specific option appears in the autocomplete that returns asynchronous `options`, it is recommended to use the shortest possible query to return the desired result. The longer the query, the longer it will take to see the results.
3693
+
3694
+ render(<IressCombobox options\={searchStarWarsCharacters} />);
3695
+ const autocomplete \= screen.getByRole('combobox');
3696
+ // DO: Use the shortest query to return the desired result
3697
+ await user.type(autocomplete, 'lu');
3698
+ const option \= await screen.findAllByRole('option');
3699
+ // DON'T: Use a long query to return the desired result
3700
+ await user.type(autocomplete, 'luke skywalker');
3701
+ const option \= await screen.findAllByRole('option');
3702
+
3703
+ ```
3704
+
3705
+ ### Use mocking when testing APIs
3706
+
3707
+ When testing the autocomplete component with asynchronous `options`, you should mock the API call to return a known set of results, rather than rely on a public prototyping API (eg. [https://swapi.py4e.com/](https://swapi.py4e.com/)). This will allow you to test the component in isolation without relying on the API to return the expected results, as well as reduce chance of flakiness due to timeouts in your tests.
3708
+
3709
+ We recommend using [Mock Service Worker](https://mswjs.io/) to mock the API calls in your tests.
3710
+
3711
+ // src/mocks/handlers.ts
3712
+ import { http, HttpResponse } from 'msw';
3713
+ export const handlers \= \[
3714
+ // Intercept "GET https://swapi.py4e.com/api/people" requests...
3715
+ http.get('https://swapi.py4e.com/api/people', () \=> {
3716
+ // ...and respond to them using this JSON response.
3717
+ return HttpResponse.json(\[
3718
+ { name: 'Luke Skywalker', gender: 'male' },
3719
+ { name: 'Leia Skywalker', gender: 'female' },
3720
+ \]);
3721
+ }),
3722
+ \];
3723
+ // src/mocks/node.js
3724
+ import { setupServer } from 'msw/node';
3725
+ import { handlers } from './handlers';
3726
+ export const server \= setupServer(...handlers);
3727
+ // src/CustomAutocomplete.test.tsx
3728
+ import { server } from './mocks/node';
3729
+ server.listen();
3730
+ render(<IressCombobox options\={searchStarWarsCharacters} />);
3731
+ const autocomplete \= screen.getByRole('combobox');
3732
+ await user.type(autocomplete, 'lu');
3733
+ const option \= await screen.findAllByRole('option');
3734
+
3735
+ ```