MCPcopy Create free account
hub / github.com/kobaltedev/kobalte / VirtualizedExample

Function VirtualizedExample

apps/docs/src/examples/select.tsx:506–535  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

504}
505
506export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected