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

Function GridListItem

starters/tailwind/src/GridList.tsx:58–77  ·  view source on GitHub ↗
({children, ...props}: GridListItemProps)

Source from the content-addressed store, hash-verified

56});
57
58export function GridListItem({children, ...props}: GridListItemProps) {
59 let textValue = typeof children === 'string' ? children : undefined;
60 return (
61 <AriaGridListItem textValue={textValue} {...props} className={itemStyles}>
62 {composeRenderProps(
63 children,
64 (children, {selectionMode, selectionBehavior, allowsDragging}) => (
65 <>
66 {/* Add elements for drag and drop and selection. */}
67 {allowsDragging && <Button slot="drag">≡</Button>}
68 {selectionMode !== 'none' && selectionBehavior === 'toggle' && (
69 <Checkbox slot="selection" />
70 )}
71 {children}
72 </>
73 )
74 )}
75 </AriaGridListItem>
76 );
77}
78
79export function GridListHeader({children, ...props}: HTMLAttributes<HTMLElement>) {
80 return (

Callers

nothing calls this directly

Calls 1

composeRenderPropsFunction · 0.85

Tested by

no test coverage detected