layout

A set of layout components for creating common page structures with header, footer, sidebar, and content areas.

PreviousNext
Header
Content
Footer
Header
Content
Footer
Header
Content
Footer
Header
Content
Footer
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { LayoutImports } from '@/shared/components/layout/layout.imports';

@Component({
  selector: 'z-demo-layout-basic',
  imports: [LayoutImports],
  template: `
    <div class="flex flex-col gap-6 text-center">
      <z-layout class="overflow-hidden rounded-lg">
        <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
        <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
        <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
      </z-layout>

      <z-layout class="overflow-hidden rounded-lg">
        <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
        <z-layout>
          <z-sidebar class="border-0 bg-[#1677ff] text-white" [zWidth]="120">Sidebar</z-sidebar>
          <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
        </z-layout>
        <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
      </z-layout>

      <z-layout class="overflow-hidden rounded-lg">
        <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
        <z-layout>
          <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
          <z-sidebar class="border-0 bg-[#1677ff] text-white" [zWidth]="120">Sidebar</z-sidebar>
        </z-layout>
        <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
      </z-layout>

      <z-layout class="overflow-hidden rounded-lg">
        <z-sidebar class="border-0 bg-[#1677ff] text-white" [zWidth]="120">Sidebar</z-sidebar>
        <z-layout>
          <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
          <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
          <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
        </z-layout>
      </z-layout>
    </div>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LayoutDemoBasicComponent {}

Installation

Copy
npx zard-cli@latest add layout

Usage

import { LayoutImports } from '@/shared/components/layout/layout.imports';
Copy
<z-layout>
  <z-header>Header</z-header>
  <z-content>Content</z-content>
  <z-footer>Footer</z-footer>
</z-layout>
Copy

Examples

basic

Header
Content
Footer
Header
Content
Footer
Header
Content
Footer
Header
Content
Footer
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { LayoutImports } from '@/shared/components/layout/layout.imports';

@Component({
  selector: 'z-demo-layout-basic',
  imports: [LayoutImports],
  template: `
    <div class="flex flex-col gap-6 text-center">
      <z-layout class="overflow-hidden rounded-lg">
        <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
        <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
        <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
      </z-layout>

      <z-layout class="overflow-hidden rounded-lg">
        <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
        <z-layout>
          <z-sidebar class="border-0 bg-[#1677ff] text-white" [zWidth]="120">Sidebar</z-sidebar>
          <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
        </z-layout>
        <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
      </z-layout>

      <z-layout class="overflow-hidden rounded-lg">
        <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
        <z-layout>
          <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
          <z-sidebar class="border-0 bg-[#1677ff] text-white" [zWidth]="120">Sidebar</z-sidebar>
        </z-layout>
        <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
      </z-layout>

      <z-layout class="overflow-hidden rounded-lg">
        <z-sidebar class="border-0 bg-[#1677ff] text-white" [zWidth]="120">Sidebar</z-sidebar>
        <z-layout>
          <z-header class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Header</z-header>
          <z-content class="min-h-50 bg-[#0958d9] text-white">Content</z-content>
          <z-footer class="h-16 justify-center border-0 bg-[#4096ff] px-12 text-white">Footer</z-footer>
        </z-layout>
      </z-layout>
    </div>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LayoutDemoBasicComponent {}

sidebar

full layout

LogoZardUI
© 2026 ZardUI

API Reference

z-layoutComponent

Root layout container with flex direction support.

PropertyDescriptionTypeDefault
[class] Additional CSS classes ClassValue ''
[zDirection] Flex direction (auto-detects based on children) 'horizontal' | 'vertical' | 'auto' 'auto'

z-headerComponent

Header area of the layout.

PropertyDescriptionTypeDefault
[class] Additional CSS classes ClassValue ''
[zHeight] Header height in pixels number 64

z-footerComponent

Footer area of the layout.

PropertyDescriptionTypeDefault
[class] Additional CSS classes ClassValue ''
[zHeight] Footer height in pixels number 64

z-contentComponent

Main content area of the layout.

PropertyDescriptionTypeDefault
[class] Additional CSS classes ClassValue ''

z-sidebarComponent

Sidebar area with optional collapse functionality.

PropertyDescriptionTypeDefault
[class] Additional CSS classes ClassValue ''
[zWidth] Sidebar width when expanded (px or string) string | number 200
[zCollapsedWidth] Sidebar width when collapsed (px) number 64
[zCollapsible] Enable collapse functionality boolean false
[zCollapsed] Collapsed state (supports two-way binding) boolean false
[zReverseArrow] Reverse trigger arrow direction boolean false
[zTrigger] Custom trigger template TemplateRef<void> | null null
(zCollapsedChange) Emitted when collapsed state changes EventEmitter<boolean>

z-sidebar-groupComponent

Groups items within the sidebar.

PropertyDescriptionTypeDefault
[class] Additional CSS classes ClassValue ''

z-sidebar-group-labelComponent

Label for a sidebar group.

PropertyDescriptionTypeDefault
[class] Additional CSS classes ClassValue ''
github iconwhatsapp icondiscord iconX icon

Made with in Brazil. Open source and available on GitHub .