Add scroll area component

This commit is contained in:
jeffvli
2022-11-03 02:26:01 -07:00
parent 061e61b7d3
commit aeefbf8f7f
2 changed files with 31 additions and 0 deletions
+1
View File
@@ -12,3 +12,4 @@ export * from './switch';
export * from './popover';
export * from './select';
export * from './date-picker';
export * from './scroll-area';
@@ -0,0 +1,30 @@
import styled from '@emotion/styled';
import {
ScrollArea as MantineScrollArea,
ScrollAreaProps as MantineScrollAreaProps,
} from '@mantine/core';
interface ScrollAreaProps extends MantineScrollAreaProps {
children: React.ReactNode;
}
const StyledScrollArea = styled(MantineScrollArea)`
& .mantine-ScrollArea-thumb {
background: var(--scrollbar-thumb-bg);
border-radius: 0;
}
& .mantine-ScrollArea-scrollbar {
width: 8px;
padding: 0;
background: var(--scrollbar-track-bg);
}
`;
export const ScrollArea = ({ children, ...props }: ScrollAreaProps) => {
return (
<StyledScrollArea offsetScrollbars {...props}>
{children}
</StyledScrollArea>
);
};