MCPcopy Index your code
hub / github.com/adobe/react-spectrum / TableHeader

Function TableHeader

starters/docs/src/Table.tsx:59–85  ·  view source on GitHub ↗
({columns, children, ...otherProps}: TableHeaderProps<T>)

Source from the content-addressed store, hash-verified

57}
58
59export function TableHeader<T>({columns, children, ...otherProps}: TableHeaderProps<T>) {
60 let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions();
61
62 return (
63 <AriaTableHeader {...otherProps}>
64 {/* Add extra columns for drag and drop and selection. */}
65 {allowsDragging && (
66 <AriaColumn
67 width={20}
68 minWidth={20}
69 style={{width: 20}}
70 className="react-aria-Column button-base"
71 />
72 )}
73 {selectionBehavior === 'toggle' && (
74 <AriaColumn
75 width={32}
76 minWidth={32}
77 style={{width: 32}}
78 className="react-aria-Column button-base">
79 {selectionMode === 'multiple' && <Checkbox slot="selection" />}
80 </AriaColumn>
81 )}
82 <Collection items={columns}>{children}</Collection>
83 </AriaTableHeader>
84 );
85}
86
87export function Row<T>({id, columns, children, ...otherProps}: RowProps<T>) {
88 let {selectionBehavior, allowsDragging} = useTableOptions();

Callers

nothing calls this directly

Calls 1

useTableOptionsFunction · 0.90

Tested by

no test coverage detected