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

Function ObjectExample

apps/docs/src/examples/combobox.tsx:280–313  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

278];
279
280export function ObjectExample() {
281 return (
282 <Combobox
283 options={ALL_OBJECT_OPTIONS}
284 optionValue="value"
285 optionTextValue="label"
286 optionLabel="label"
287 optionDisabled="disabled"
288 placeholder="Search a fruit…"
289 itemComponent={(props) => (
290 <Combobox.Item item={props.item} class={style.combobox__item}>
291 <Combobox.ItemLabel>{props.item.rawValue.label}</Combobox.ItemLabel>
292 <Combobox.ItemIndicator class={style["combobox__item-indicator"]}>
293 <CheckIcon />
294 </Combobox.ItemIndicator>
295 </Combobox.Item>
296 )}
297 >
298 <Combobox.Control class={style.combobox__control} aria-label="Fruit">
299 <Combobox.Input class={style.combobox__input} />
300 <Combobox.Trigger class={style.combobox__trigger}>
301 <Combobox.Icon class={style.combobox__icon}>
302 <CaretSortIcon />
303 </Combobox.Icon>
304 </Combobox.Trigger>
305 </Combobox.Control>
306 <Combobox.Portal>
307 <Combobox.Content class={style.combobox__content}>
308 <Combobox.Listbox class={style.combobox__listbox} />
309 </Combobox.Content>
310 </Combobox.Portal>
311 </Combobox>
312 );
313}
314
315interface Category {
316 label: string;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected