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

Function Column

starters/tailwind/src/Table.tsx:62–93  ·  view source on GitHub ↗
(props: ColumnProps)

Source from the content-addressed store, hash-verified

60});
61
62export function Column(props: ColumnProps) {
63 return (
64 <AriaColumn
65 {...props}
66 className={composeTailwindRenderProps(
67 props.className,
68 'box-border h-1 [&:hover]:z-20 focus-within:z-20 text-start text-sm font-semibold text-neutral-700 dark:text-neutral-300 cursor-default'
69 )}>
70 {composeRenderProps(props.children, (children, {allowsSorting, sortDirection}) => (
71 <div className="flex items-center">
72 <Group role="presentation" tabIndex={-1} className={columnStyles}>
73 <span className="truncate">{children}</span>
74 {allowsSorting && (
75 <span
76 className={`w-4 h-4 flex items-center justify-center transition ${
77 sortDirection === 'descending' ? 'rotate-180' : ''
78 }`}>
79 {sortDirection && (
80 <ArrowUp
81 aria-hidden
82 className="w-4 h-4 text-neutral-500 dark:text-neutral-400 forced-colors:text-[ButtonText]"
83 />
84 )}
85 </span>
86 )}
87 </Group>
88 {!props.width && <ColumnResizer className={resizerStyles} />}
89 </div>
90 ))}
91 </AriaColumn>
92 );
93}
94
95export function TableHeader<T>(props: TableHeaderProps<T>) {
96 let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions();

Callers

nothing calls this directly

Calls 2

composeRenderPropsFunction · 0.85

Tested by

no test coverage detected