import { Component } from '@angular/core';
import { WrLayout, WrLayoutContent, WrLayoutFooter, WrLayoutHeader, WrLayoutSider } from 'ngwr/layout';
@Component({ imports: [WrLayout, WrLayoutContent, WrLayoutFooter, WrLayoutHeader, WrLayoutSider] })
export class MyComponent {}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.
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>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>API
| Name | Description | Type | Default |
|---|---|---|---|
<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. | boolean | false |
width | Width when expanded. Any CSS length. | string | '16rem' |
collapsedWidth | Width when collapsed. Any CSS length; 0 fully hides it. | string | '4rem' |
reverse | Place the sider on the right edge instead of the left. | boolean | false |
(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
Component SidebarNavigation drawn from data: pages and groups, three levels deep.Guide GridLay out a page with a 12-column grid, containers and breakpoint mixins.Component Page HeaderA page title with slots for breadcrumbs, actions and tags.Component BurgerA menu button that morphs between a hamburger and a close mark.Component SplitterTwo panes with a divider the user drags or moves with the arrow keys.