Files
blitzkit/src/components/StickyColumnHeaderCell.tsx
T

25 lines
540 B
TypeScript
Raw Normal View History

2024-07-12 13:01:10 -05:00
import { Table } from '@radix-ui/themes';
import { ColumnHeaderCellProps } from '@radix-ui/themes/dist/cjs/components/table';
2024-07-12 19:55:41 -05:00
interface StickyColumnHeaderCellProps extends ColumnHeaderCellProps {
top?: number | string;
}
2024-07-12 13:01:10 -05:00
export function StickyColumnHeaderCell({
style,
2024-07-12 19:55:41 -05:00
top = 0,
2024-07-12 13:01:10 -05:00
...props
2024-07-12 19:55:41 -05:00
}: StickyColumnHeaderCellProps) {
2024-07-12 13:01:10 -05:00
return (
<Table.ColumnHeaderCell
style={{
position: 'sticky',
2024-07-12 19:55:41 -05:00
top,
2024-07-12 13:01:10 -05:00
background: 'var(--gray-3)',
zIndex: 1,
...style,
}}
{...props}
/>
);
}