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

Function GridListItem

starters/docs/src/GridList.tsx:27–52  ·  view source on GitHub ↗
({
  children,
  ...props
}: Omit<GridListItemProps, 'children'> & {
  children?: React.ReactNode;
})

Source from the content-addressed store, hash-verified

25}
26
27export function GridListItem({
28 children,
29 ...props
30}: Omit<GridListItemProps, 'children'> & {
31 children?: React.ReactNode;
32}) {
33 let textValue = typeof children === 'string' ? children : undefined;
34 return (
35 <AriaGridListItem textValue={textValue} {...props}>
36 {({selectionMode, selectionBehavior, allowsDragging}) => (
37 <>
38 {/* Add elements for drag and drop and selection. */}
39 {allowsDragging && (
40 <Button slot="drag">
41 <GripVertical size={16} />
42 </Button>
43 )}
44 {selectionMode === 'multiple' && selectionBehavior === 'toggle' && (
45 <Checkbox slot="selection" />
46 )}
47 {children}
48 </>
49 )}
50 </AriaGridListItem>
51 );
52}
53
54export function GridListLoadMoreItem(props: GridListLoadMoreItemProps) {
55 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected