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

Function ObjectExample

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

Source from the content-addressed store, hash-verified

254];
255
256export function ObjectExample() {
257 return (
258 <Select
259 options={OBJECT_OPTIONS}
260 optionValue="value"
261 optionTextValue="label"
262 optionDisabled="disabled"
263 placeholder="Select a food…"
264 itemComponent={(props) => (
265 <Select.Item item={props.item} class={style.select__item}>
266 <Select.ItemLabel>{props.item.rawValue.label}</Select.ItemLabel>
267 <Select.ItemIndicator class={style["select__item-indicator"]}>
268 <CheckIcon />
269 </Select.ItemIndicator>
270 </Select.Item>
271 )}
272 >
273 <Select.Trigger class={style.select__trigger} aria-label="Food">
274 <Select.Value<Food> class={style.select__value}>
275 {(state) => state.selectedOption().label}
276 </Select.Value>
277 <Select.Icon class={style.select__icon}>
278 <CaretSortIcon />
279 </Select.Icon>
280 </Select.Trigger>
281 <Select.Portal>
282 <Select.Content class={style.select__content}>
283 <Select.Listbox class={style.select__listbox} />
284 </Select.Content>
285 </Select.Portal>
286 </Select>
287 );
288}
289
290interface Category {
291 label: string;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected