mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 07:43:49 +01:00
flatten components
This commit is contained in:
150 files changed
+2160
-6895
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { Table } from '@radix-ui/themes';
|
||||
import type { RootProps } from '@radix-ui/themes/src/components/table.js';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
export function StickyTableRoot({ style, ...props }: RootProps) {
|
||||
const table = useRef<HTMLTableElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
table.current
|
||||
?.querySelector('table')
|
||||
?.style.setProperty('overflow', 'auto');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Table.Root
|
||||
{...props}
|
||||
ref={table}
|
||||
style={{ overflow: 'hidden', ...style }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user