Skip to content

Sidebar Header Toggle

Last updated 27 Oct 2026

NbSidebarHeaderToggle collapses and expands the rail from the top of the sidebar, beside the brand, instead of from a row at the bottom. It goes in NbShell's sidebar-header-action slot, which is opt-in: a shell that leaves the slot empty renders exactly as it did before, so NbSidebarCollapseToggle in #sidebar-bottom stays the default.

Try it ​

Pick a position and a compact behaviour, then use the toggle itself to collapse and expand the rail. Shrink the browser window below 672px to see the drawer layout.

Positions ​

PositionExpanded railCollapsed rail
endBrand, then the toggle at the far edgeSet by sidebarHeaderActionCompact
startToggle first, then the brand, as a top bar wouldSet by sidebarHeaderActionCompact
edgeA small round tab on the rail's border, level with the brandThe same tab, pointing the other way

The collapsed rail ​

The 56px rail has no room for the brand and the toggle side by side, so sidebarHeaderActionCompact picks how they share it:

  • stack: both, one above the other. With start the toggle is on top, with end it is below.
  • swap: the brand, which turns into the toggle under the pointer or keyboard focus. On a screen without hover it behaves as replace, since a control that only appears on hover would be out of reach.
  • replace: the toggle alone, in the brand's place.

On phones ​

Below collapseAt the rail becomes a drawer opened from the topbar's nav button, and the header action is not rendered at all. The nav button is already the control there, and a drawer has no compact form to collapse into. The drawer also always shows labels: someone who collapsed the rail on a desktop gets the full menu on their phone, while their saved choice is left alone for the next desktop visit.