Layout

An app shell: header, sider, content and footer.

Installation

Import the class, and @use the entry point in your global styles: without it the component renders unstyled.

import { Component } from '@angular/core';
import { WrLayout, WrLayoutContent, WrLayoutFooter, WrLayoutHeader, WrLayoutSider } from 'ngwr/layout';

@Component({ imports: [WrLayout, WrLayoutContent, WrLayoutFooter, WrLayoutHeader, WrLayoutSider] })
export class MyComponent {}

Header / content / footer

<wr-layout>
  <wr-layout-header>App bar</wr-layout-header>
  <wr-layout-content>Main</wr-layout-content>
  <wr-layout-footer>© 2026</wr-layout-footer>
</wr-layout>
App barMain content area© 2026

Collapsible sider

A <wr-layout> holding a <wr-layout-sider> becomes a row. Bind [(collapsed)] on the sider.

<wr-layout>
  <wr-layout-header>App bar</wr-layout-header>
  <wr-layout>
    <wr-layout-sider [(collapsed)]="collapsed">Sidebar</wr-layout-sider>
    <wr-layout-content>Main</wr-layout-content>
  </wr-layout>
</wr-layout>
Sidebar
Main content area

API

NameDescriptionTypeDefault
<wr-layout>A column; a row when a <wr-layout-sider> is a direct child.component—
<wr-layout-header>Top bar (role="banner"). Doesn't grow.component—
<wr-layout-sider>Collapsible side panel. toggle() flips the collapsed state.component—
[(collapsed)]Two-way bindable collapsed state.booleanfalse
widthWidth when expanded. Any CSS length.string'16rem'
collapsedWidthWidth when collapsed. Any CSS length; 0 fully hides it.string'4rem'
reversePlace the sider on the right edge instead of the left.booleanfalse
(collapsedChanged)Emits whenever collapsed changes, alongside the two-way binding.boolean—
<wr-layout-content>Main area (role="main"). Flex-grows to fill.component—
<wr-layout-footer>Bottom bar (role="contentinfo"). Doesn't grow.component—

See also