Layout scaffolding for Web apps.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
709 B

  1. import * as React from 'react';
  2. import clsx from 'clsx';
  3. export interface LeftSidebarBaseProps extends React.HTMLProps<HTMLDivElement> {}
  4. export const LeftSidebarBase = React.forwardRef<HTMLDivElement, LeftSidebarBaseProps>(({
  5. children,
  6. open = false,
  7. ...etcProps
  8. }, ref) => {
  9. return (
  10. <div
  11. className={clsx(
  12. 'box-border fixed top-0 -left-full w-full h-full bg-bg md:left-0 md:w-[calc(50%-(var(--base-width)*0.5))] scrollbar-hidden',
  13. open && 'left-0',
  14. )}
  15. {...etcProps}
  16. ref={ref}
  17. >
  18. <div
  19. className="w-full h-full overflow-auto relative z-[1]"
  20. >
  21. {children}
  22. </div>
  23. </div>
  24. );
  25. });
  26. LeftSidebarBase.displayName = 'LeftSidebarBase'