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.
 
 
 

32 lines
741 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. className,
  8. ...etcProps
  9. }, ref) => {
  10. return (
  11. <div
  12. className={clsx(
  13. 'box-border fixed top-0 -left-full w-full h-full bg-sidebar md:left-0 md:w-[calc(50%-(var(--base-width)*0.5))] scrollbar-hidden',
  14. open && 'left-0',
  15. className,
  16. )}
  17. {...etcProps}
  18. ref={ref}
  19. >
  20. <div
  21. className="w-full h-full overflow-auto relative z-[1]"
  22. >
  23. {children}
  24. </div>
  25. </div>
  26. );
  27. });
  28. LeftSidebarBase.displayName = 'LeftSidebarBase'