Component
Layout
An application scaffold of header, content, footer, and sidebar. Nest layouts to combine directions, size each region, and add a collapsible sidebar with a built-in trigger.
Header, content & footer
Content area. It scrolls independently while the header and footer stay pinned.
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { NgIcon, provideIcons } from '@ng-icons/core';
import { phosphorLeaf } from '@ng-icons/phosphor-icons/regular';
import { HbLayoutImports } from '@herbst/ui';
@Component({
selector: 'hb-demo-layout-basic',
imports: [HbLayoutImports, NgIcon],
viewProviders: [provideIcons({ phosphorLeaf })],
template: `
<hb-layout
hbDirection="vertical"
class="h-72 w-full max-w-xl overflow-hidden rounded-md border border-border"
>
<hb-header [hbHeight]="56">
<span class="flex items-center gap-2 font-medium">
<ng-icon name="phosphorLeaf" class="text-primary" />
Herbst
</span>
</hb-header>
<hb-content>
<p class="text-sm text-muted-foreground">
Content area. It scrolls independently while the header and footer stay pinned.
</p>
</hb-content>
<hb-footer [hbHeight]="40">© 2026 — Herbst</hb-footer>
</hb-layout>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HbDemoLayoutBasicComponent {}
Sidebar with groups
A sidebar makes the outer layout horizontal automatically (hbDirection="auto").
Collapsible sidebar
API reference
hb-layout
| Property | Description | Type | Default |
|---|---|---|---|
| [hbDirection] | Flow of the direct children. auto is horizontal when a sidebar is present, otherwise vertical. Nest layouts to mix both. | 'auto' | 'horizontal' | 'vertical' | 'auto' |
Regions
| Property | Description | Type | Default |
|---|---|---|---|
| hb-header [hbHeight] | Top bar with a fixed height in pixels. | number | 64 |
| hb-content | The scrollable main region; grows to fill the remaining space. | component | — |
| hb-footer [hbHeight] | Bottom bar with a fixed height in pixels. | number | 64 |
hb-layout-sidebar
| Property | Description | Type | Default |
|---|---|---|---|
| [hbWidth] | Expanded width — a number (px) or any CSS length string. | string | number | 200 |
| [hbCollapsible] / [hbCollapsedWidth] | Show the toggle trigger, and set the width when collapsed. | boolean / number | false / 64 |
| [(hbCollapsed)] | Two-way collapsed state. Also exposed via the toggle() method (exportAs "hbLayoutSidebar"). | boolean | false |
| [hbReverseArrow] | Flip the direction the trigger arrow points — for right-hand sidebars. | boolean | false |
| [hbTrigger] | A TemplateRef replacing the default arrow icon in the trigger. | TemplateRef | null | null |
| (hbOnCollapsedChange) | Emits the new collapsed state when toggled. | boolean | — |
Sidebar content
| Property | Description | Type | Default |
|---|---|---|---|
| hb-layout-sidebar-group | Groups navigation items with vertical spacing. | component | — |
| hb-layout-sidebar-group-label | A small uppercase caption above a group. | component | — |