siriwatknp / mui-treasury

A collection of ready-to-use components based on Material-UI
https://mui-treasury.com
MIT License
2.38k stars 151 forks source link

Help with layout configuration: header clipped with temporay sidebar #1208

Closed gremo closed 2 months ago

gremo commented 1 year ago

As you can see from my scheme, the header is clipped (above sidebar) starting from lg breakpoint:

import { Scheme } from '@mui-treasury/layout';

export const layout: Scheme = {
  header: {
    config: {
      xs: { position: 'fixed', height: 56, clipped: false },
      lg: { position: 'fixed', height: 64, clipped: true }, // starting from here, header is clipped
    },
  },

  // Header clip is fine for the leftEdgeSidebar because it's permanent on lg
  leftEdgeSidebar: {
    autoCollapse: 'lg',
    config: {
      xs: { variant: 'temporary', width: 256 },
      lg: {
        variant: 'permanent',
        width: 256,
        collapsible: true,
        collapsedWidth: 64,
        headerMagnetEnabled: true
      }
    },
  },

  // Header clip is not fine because rightEdgeSidebar is still temporary on lg (it's ok from xl and up)
  rightEdgeSidebar: {
    config: {
      xs: { variant: 'temporary', width: 256 },
      xl: { variant: 'permanent', width: 256 },
    }
  },
};

For leftEdgeSidebar this is fine: at lg breakpoint header is clipped but sidebar is permanent.

This configuration however won't work fine for rightEdgeSidebar: there is a "gap" between lg and xl when header is clipped and rightEdgeSidebar is still temporary.

image image image

Any idea how to solve this, aside from lowering the breakpoint from xlto lg for rightEdgeSidebar?

siriwatknp commented 2 months ago

Layout v5 is no longer maintained. I am working on the migration guide to Layout v6.

https://mui-treasury.com/?path=/docs/layout-v6-configuration-edge-sidebar--docs#right-edge-sidebar