Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawer alignment below the appBar #11217

Closed
ghost opened this issue May 2, 2018 · 10 comments
Closed

Drawer alignment below the appBar #11217

ghost opened this issue May 2, 2018 · 10 comments
Labels
component: drawer This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement

Comments

@ghost
Copy link

ghost commented May 2, 2018

Hi,

how can we place drawer (either it is permanent or responsive drawer) below the appbar ?
All the examples provided in material-ui-next web page , are starts with Appbar.

My required is to keep Appbar fixed and drawer should be open and close below the appbar.

Thanks

@oliviertassinari
Copy link
Member

oliviertassinari commented May 2, 2018

This demo renders the drawer bellow the AppBar: https://material-ui.com/demos/drawers/#clipped-under-the-app-bar

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: drawer This is the name of the generic UI component, not the React module! labels May 2, 2018
@oliviertassinari oliviertassinari added support: question Community support but can be turned into an improvement and removed docs Improvements or additions to the documentation labels May 2, 2018
@ghost
Copy link
Author

ghost commented May 2, 2018

Clipped drawer doesn't have facility to close and open drawer, it will just stick as side navigation.
I'm looking for persistent drawer or responsive drawer which can be close or open based on user action.

@oliviertassinari
Copy link
Member

@code4arpit Then you won't find your answer here. Maybe you can try StackOverflow. We will add some layout demo in the future with #10986

@AikoRamalho
Copy link

Same problem here. Stack Overflow doesn't seems to have a response to.

@loupollivier
Copy link

loupollivier commented Apr 4, 2019

Same here, is there some modifications since last time? I found no answer or exemple of it in the documentation https://material-ui.com/demos/drawers/

@yashrahurikar
Copy link

Hi,

how can we place drawer (either it is permanent or responsive drawer) below the appbar ?
All the examples provided in material-ui-next web page , are starts with Appbar.

My required is to keep Appbar fixed and drawer should be open and close below the appbar.

Thanks

You can use the z-index css property for layering AppBar above the Drawer
e.g. in withStyles
appBar: {
[theme.breakpoints.up("sm")]: {
width: "100%"
},
zIndex: theme.zIndex.drawer + 1
}

By default this class is applied on the AppBar component

keep the Drawer components variant to be "temporary" for responsiveness

@loupollivier
Copy link

Hi,
how can we place drawer (either it is permanent or responsive drawer) below the appbar ?
All the examples provided in material-ui-next web page , are starts with Appbar.
My required is to keep Appbar fixed and drawer should be open and close below the appbar.
Thanks

You can use the z-index css property for layering AppBar above the Drawer
e.g. in withStyles
appBar: {
[theme.breakpoints.up("sm")]: {
width: "100%"
},
zIndex: theme.zIndex.drawer + 1
}

By default this class is applied on the AppBar component

keep the Drawer components variant to be "temporary" for responsiveness

It worked for me thank you!

@nemethricsi
Copy link

nemethricsi commented Jun 11, 2020

adding { name: 'HookGlobalStyles', index: 2 } as a second parameter to makeStyles solved the issue for me:

My problem was that in production build the <Backdrop /> component didn't got the backdrop style

const useStyles = makeStyles((theme) => ({
  backdrop: {
    zIndex: theme.zIndex.drawer + 1,
    color: '#fff',
  },
}), { name: 'HookGlobalStyles', index: 2 });

@yhay81
Copy link

yhay81 commented Jun 23, 2020

I am also in the same case.
And I found using

Drawer with variant="persistent"
and
AppBar with style={{zIndex:1301}} (okay with theme.zIndex.drawer + 1)

Works for me.

@killjoy2013
Copy link

I am also in the same case. And I found using

Drawer with variant="persistent" and AppBar with style={{zIndex:1301}} (okay with theme.zIndex.drawer + 1)

Works for me.

Hey @yhay81, can you please give us a working sandbox? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: drawer This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

7 participants