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

Function TreeItemContent

starters/docs/src/Tree.tsx:25–48  ·  view source on GitHub ↗
(
  props: Omit<TreeItemContentProps, 'children'> & {children?: React.ReactNode}
)

Source from the content-addressed store, hash-verified

23}
24
25export function TreeItemContent(
26 props: Omit<TreeItemContentProps, 'children'> & {children?: React.ReactNode}
27) {
28 return (
29 <AriaTreeItemContent>
30 {({selectionBehavior, selectionMode, allowsDragging}: TreeItemContentRenderProps) => (
31 <>
32 {allowsDragging && (
33 <Button slot="drag">
34 <GripVertical size={16} />
35 </Button>
36 )}
37 {selectionBehavior === 'toggle' && selectionMode !== 'none' && (
38 <Checkbox slot="selection" />
39 )}
40 <Button slot="chevron">
41 <ChevronRight />
42 </Button>
43 {props.children}
44 </>
45 )}
46 </AriaTreeItemContent>
47 );
48}
49
50export interface TreeItemProps extends Partial<AriaTreeItemProps> {
51 title?: React.ReactNode;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected