MCPcopy Create free account
hub / github.com/adobe/react-spectrum / DropdownItem

Function DropdownItem

starters/docs/src/ListBox.tsx:51–64  ·  view source on GitHub ↗
(props: ListBoxItemProps)

Source from the content-addressed store, hash-verified

49}
50
51export function DropdownItem(props: ListBoxItemProps) {
52 let textValue =
53 props.textValue || (typeof props.children === 'string' ? props.children : undefined);
54 return (
55 <ListBoxItem {...props} textValue={textValue} className="dropdown-item">
56 {composeRenderProps(props.children, (children, {isSelected}) => (
57 <>
58 {isSelected && <Check />}
59 {typeof children === 'string' ? <Text slot="label">{children}</Text> : children}
60 </>
61 ))}
62 </ListBoxItem>
63 );
64}
65
66export {Text, Header};

Callers

nothing calls this directly

Calls 1

composeRenderPropsFunction · 0.85

Tested by

no test coverage detected