AppShell
Header on top, sidebar on the left, scrolling main area. Below the md breakpoint the sidebar moves into a drawer behind a menu button. sidebar can be a function (close) => node to close the drawer on selection. The shell fills the viewport height; size it with className when embedding.
sidebarCollapsedBelow="lg" shows the sidebar as an icon rail between md and lg: use the function form, (close, { inDrawer, collapsed }), and pass collapsed to Sidebar. menuButtonVariant and menuButtonProps customise the mobile menu button. Put an AppBar with embedded in header to avoid a double frame.
Showing: home
Showing: home
Props
sidebarCollapsedBelow'lg'Show the inline sidebar as an icon rail between
mdand this breakpoint; asidebarfunction receivescollapsed.sidebarFullHeightbooleanDefault:falseThe sidebar runs the full height with the header only over the content column.
menuButtonVariantButtonVariantDefault:secondaryVariant of the mobile menu button.
menuButtonPropsButtonPropsExtra props for the mobile menu button (
className,aria-label, ...).headerReactNodeHeader content.
sidebarReactNode | (close, { inDrawer, collapsed }) => ReactNodeSidebar; a function receives
closefor the mobile drawer, and whether it is in the drawer or the icon rail.sidebarTitlestringDefault:'Menu'Title of the mobile drawer.
childrenReactNodeMain content.
classNamestringDefault:''Extra classes for the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
sidebarCollapsedBelow | 'lg' | – | Show the inline sidebar as an icon rail between md and this breakpoint; a sidebar function receives collapsed. |
sidebarFullHeight | boolean | false | The sidebar runs the full height with the header only over the content column. |
menuButtonVariant | ButtonVariant | secondary | Variant of the mobile menu button. |
menuButtonProps | ButtonProps | – | Extra props for the mobile menu button (className, aria-label, ...). |
header | ReactNode | – | Header content. |
sidebar | ReactNode | (close, { inDrawer, collapsed }) => ReactNode | – | Sidebar; a function receives close for the mobile drawer, and whether it is in the drawer or the icon rail. |
sidebarTitle | string | 'Menu' | Title of the mobile drawer. |
children | ReactNode | – | Main content. |
className | string | '' | Extra classes for the root element. |