App Shell
Responsive application layouts for React built with the Shell components, with sticky headers, collapsible sidebars, nested shells, and colored surfaces.
Examples
Overview
These examples build complete page layouts with the Ariakit UI Shell components. Each example is a full page, so headers stick and sidebars scroll with the page. Open a preview in a new tab and resize the window to see how the sidebars fold at narrow widths.
Components
Shell places a header, up to two sidebars per side, a main area, and a footer in one CSS grid. Put a Shell inside another Shell to give a sidebar the full page height beside the header. ShellMain holds an optional sticky ShellMainHeader, a ShellMainIntro, and a ShellMainBody. Use ShellPopout, ShellFeature, ShellWide, and ShellFull to make content wider than the centered column. ShellWide stays centered on the content when an open sidebar offsets it, and ShellFull reaches both edges of the main area.
ShellStart, ShellCenter, and ShellEnd place parts in ShellHeader, ShellFooter, and ShellMainHeader. To align content in these parts with the column in main, render ShellContent or a wider band instead of ShellCenter. The content aligns while it has room. If a side part needs more room, only the edge next to that part moves. Set $size on ShellMain to share its column with the bars. For a custom column or gutter, set the same $maxWidth on the bar, and set $gutter on the bar to the value of $p on ShellMain. Numbers follow the text of the element that they are on, so when ShellMain sets $size, use a CSS length such as 48rem on both.