()
| 504 | } |
| 505 | |
| 506 | export function VirtualizedExample() { |
| 507 | const options: Item[] = Array.from({ length: 100_000 }, (_, i) => ({ |
| 508 | value: `${i}`, |
| 509 | label: `Item #${i + 1}`, |
| 510 | disabled: false, |
| 511 | })); |
| 512 | |
| 513 | return ( |
| 514 | <Select |
| 515 | virtualized |
| 516 | options={options} |
| 517 | optionValue="value" |
| 518 | optionTextValue="label" |
| 519 | optionDisabled="disabled" |
| 520 | placeholder="Select an item…" |
| 521 | > |
| 522 | <Select.Trigger class={style.select__trigger} aria-label="Food"> |
| 523 | <Select.Value<Item> class={style.select__value}> |
| 524 | {(state) => state.selectedOption().label} |
| 525 | </Select.Value> |
| 526 | <Select.Icon class={style.select__icon}> |
| 527 | <CaretSortIcon /> |
| 528 | </Select.Icon> |
| 529 | </Select.Trigger> |
| 530 | <Select.Portal> |
| 531 | <SelectContent options={options} /> |
| 532 | </Select.Portal> |
| 533 | </Select> |
| 534 | ); |
| 535 | } |
nothing calls this directly
no outgoing calls
no test coverage detected