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

Function TableHeader

starters/tailwind/src/Table.tsx:95–118  ·  view source on GitHub ↗
(props: TableHeaderProps<T>)

Source from the content-addressed store, hash-verified

93}
94
95export function TableHeader<T>(props: TableHeaderProps<T>) {
96 let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions();
97
98 return (
99 <AriaTableHeader
100 {...props}
101 className={composeTailwindRenderProps(
102 props.className,
103 'sticky top-0 z-10 bg-neutral-100/60 dark:bg-neutral-700/60 backdrop-blur-md supports-[-moz-appearance:none]:bg-neutral-100 dark:supports-[-moz-appearance:none]:bg-neutral-700 forced-colors:bg-[Canvas] rounded-t-lg border-b border-b-neutral-200 dark:border-b-neutral-700'
104 )}>
105 {/* Add extra columns for drag and drop and selection. */}
106 {allowsDragging && <Column />}
107 {selectionBehavior === 'toggle' && (
108 <AriaColumn
109 width={36}
110 minWidth={36}
111 className="box-border p-2 text-sm font-semibold cursor-default text-start">
112 {selectionMode === 'multiple' && <Checkbox slot="selection" />}
113 </AriaColumn>
114 )}
115 <Collection items={props.columns}>{props.children}</Collection>
116 </AriaTableHeader>
117 );
118}
119
120export function TableBody<T>(props: TableBodyProps<T>) {
121 return <AriaTableBody {...props} className="empty:italic empty:text-center empty:text-sm" />;

Callers

nothing calls this directly

Calls 2

useTableOptionsFunction · 0.90

Tested by

no test coverage detected