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

Function DropdownItem

starters/tailwind/src/ListBox.tsx:86–103  ·  view source on GitHub ↗
(props: ListBoxItemProps)

Source from the content-addressed store, hash-verified

84});
85
86export function DropdownItem(props: ListBoxItemProps) {
87 let textValue =
88 props.textValue || (typeof props.children === 'string' ? props.children : undefined);
89 return (
90 <AriaListBoxItem {...props} textValue={textValue} className={dropdownItemStyles}>
91 {composeRenderProps(props.children, (children, {isSelected}) => (
92 <>
93 <span className="flex items-center flex-1 gap-2 font-normal truncate group-selected:font-semibold">
94 {children}
95 </span>
96 <span className="flex items-center w-5">
97 {isSelected && <Check className="w-4 h-4" />}
98 </span>
99 </>
100 ))}
101 </AriaListBoxItem>
102 );
103}
104
105export interface DropdownSectionProps<T> extends ListBoxSectionProps<T> {
106 title?: string;

Callers

nothing calls this directly

Calls 1

composeRenderPropsFunction · 0.85

Tested by

no test coverage detected