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

Function ListBoxItem

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

Source from the content-addressed store, hash-verified

46});
47
48export function ListBoxItem(props: ListBoxItemProps) {
49 let textValue =
50 props.textValue || (typeof props.children === 'string' ? props.children : undefined);
51 return (
52 <AriaListBoxItem {...props} textValue={textValue} className={itemStyles}>
53 {composeRenderProps(props.children, children => (
54 <>
55 {children}
56 <div className="absolute left-4 right-4 bottom-0 h-px bg-white/20 forced-colors:bg-[HighlightText] hidden [.group[data-selected]:has(+[data-selected])_&]:block" />
57 </>
58 ))}
59 </AriaListBoxItem>
60 );
61}
62
63export const dropdownItemStyles = tv({
64 base: 'group flex items-center gap-4 cursor-default select-none py-2 pl-3 pr-3 selected:pr-1 rounded-lg outline outline-0 text-sm forced-color-adjust-none no-underline [&[href]]:cursor-pointer [-webkit-tap-highlight-color:transparent]',

Callers

nothing calls this directly

Calls 1

composeRenderPropsFunction · 0.85

Tested by

no test coverage detected