Componente

Layout

Um scaffold de aplicação com header, conteúdo, footer e sidebar. Aninhe layouts para combinar direções, dimensione cada região, e adicione uma sidebar colapsável com gatilho embutido.

Header, conteúdo e footer

Herbst

Content area. It scrolls independently while the header and footer stay pinned.

© 2026 — Herbst
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 com grupos

Photos

A sidebar makes the outer layout horizontal automatically (hbDirection="auto").

248 photos

Sidebar colapsável

expanded
Dashboard

The sidebar collapses to 200px. The trigger arrow is reversed, and the collapsed state is two-way bound.

Referência de API

hb-layout

PropriedadeDescriçãoTipoPadrão
[hbDirection] Fluxo dos filhos diretos. auto é horizontal quando há uma sidebar, senão vertical. Aninhe layouts para misturar os dois. 'auto' | 'horizontal' | 'vertical' 'auto'

Regions

PropriedadeDescriçãoTipoPadrão
hb-header [hbHeight] Barra superior com altura fixa em pixels. number 64
hb-content A região principal rolável; cresce para preencher o espaço restante. component
hb-footer [hbHeight] Barra inferior com altura fixa em pixels. number 64

hb-layout-sidebar

PropriedadeDescriçãoTipoPadrão
[hbWidth] Largura expandida — um número (px) ou qualquer string de comprimento CSS. string | number 200
[hbCollapsible] / [hbCollapsedWidth] Mostra o gatilho de alternância, e define a largura quando colapsada. boolean / number false / 64
[(hbCollapsed)] Estado colapsado bidirecional. Também exposto via método toggle() (exportAs "hbLayoutSidebar"). boolean false
[hbReverseArrow] Inverte a direção que a seta do gatilho aponta — para sidebars à direita. boolean false
[hbTrigger] Um TemplateRef que substitui o ícone de seta padrão no gatilho. TemplateRef | null null
(hbOnCollapsedChange) Emite o novo estado colapsado ao alternar. boolean

Sidebar content

PropriedadeDescriçãoTipoPadrão
hb-layout-sidebar-group Agrupa itens de navegação com espaçamento vertical. component
hb-layout-sidebar-group-label Uma pequena legenda em maiúsculas acima de um grupo. component