tabs

A set of layered sections of content—known as tab panels—that are displayed one at a time.

PreviousNext
OverviewView your key metrics and recent project activity. Track progress across all your active projects.

You have 12 active projects and 3 pending tasks.

import { Component } from '@angular/core';

import { ZardCardImports } from '@/shared/components/card/card.imports';

import { ZardTabComponent, ZardTabGroupComponent } from '../tabs.component';

@Component({
  selector: 'z-demo-tabs-default',
  imports: [ZardTabComponent, ZardTabGroupComponent, ZardCardImports],
  template: `
    <z-tab-group class="w-[400px]">
      <z-tab label="Overview">
        <z-card>
          <z-card-header>
            <z-card-title zTitle="Overview" />
            <z-card-description
              zDescription="View your key metrics and recent project activity. Track progress across all your active projects."
            />
          </z-card-header>
          <p z-card-content class="text-muted-foreground text-sm">You have 12 active projects and 3 pending tasks.</p>
        </z-card>
      </z-tab>
      <z-tab label="Analytics">
        <z-card>
          <z-card-header>
            <z-card-title zTitle="Analytics" />
            <z-card-description
              zDescription="Track performance and user engagement metrics. Monitor trends and identify growth opportunities."
            />
          </z-card-header>
          <p z-card-content class="text-muted-foreground text-sm">Page views are up 25% compared to last month.</p>
        </z-card>
      </z-tab>
      <z-tab label="Reports">
        <z-card>
          <z-card-header>
            <z-card-title zTitle="Reports" />
            <z-card-description
              zDescription="Generate and download your detailed reports. Export data in multiple formats for analysis."
            />
          </z-card-header>
          <p z-card-content class="text-muted-foreground text-sm">You have 5 reports ready and available to export.</p>
        </z-card>
      </z-tab>
      <z-tab label="Settings">
        <z-card>
          <z-card-header>
            <z-card-title zTitle="Settings" />
            <z-card-description
              zDescription="Manage your account preferences and options. Customize your experience to fit your needs."
            />
          </z-card-header>
          <p z-card-content class="text-muted-foreground text-sm">Configure notifications, security, and themes.</p>
        </z-card>
      </z-tab>
    </z-tab-group>
  `,
})
export class ZardDemoTabsDefaultComponent {}

Installation

Copy
npx zard-cli@latest add tabs

Usage

import { ZardTabComponent } from '@/shared/components/tabs/tab.component';
import { ZardTabGroupComponent } from '@/shared/components/tabs/tabs.component';
Copy
<z-tab-group>
  <z-tab label="Account">Account content here.</z-tab>
  <z-tab label="Password">Password content here.</z-tab>
</z-tab-group>
Copy

Examples

line

Use the zVariant="line" prop on z-tab-group for a line style.

import { Component } from '@angular/core';

import { ZardTabComponent, ZardTabGroupComponent } from '../tabs.component';

@Component({
  selector: 'z-demo-tabs-line',
  imports: [ZardTabComponent, ZardTabGroupComponent],
  standalone: true,
  template: `
    <z-tab-group zVariant="line">
      <z-tab label="Overview" />
      <z-tab label="Analytics" />
      <z-tab label="Reports" />
    </z-tab-group>
  `,
})
export class ZardDemoTabsLineComponent {}

vertical

Use zOrientation="vertical" for vertical tabs.

import { Component } from '@angular/core';

import { ZardTabComponent, ZardTabGroupComponent } from '../tabs.component';

@Component({
  selector: 'z-demo-tabs-vertical',
  imports: [ZardTabComponent, ZardTabGroupComponent],
  standalone: true,
  template: `
    <div class="flex w-full max-w-md flex-col gap-6">
      <z-tab-group zOrientation="vertical">
        <z-tab label="Account" />
        <z-tab label="Password" />
        <z-tab label="Notifications" />
      </z-tab-group>

      <z-tab-group zOrientation="vertical" zVariant="line">
        <z-tab label="Account" />
        <z-tab label="Password" />
        <z-tab label="Notifications" />
      </z-tab-group>
    </div>
  `,
})
export class ZardDemoTabsVerticalComponent {}

disabled

import { Component } from '@angular/core';

import { ZardTabComponent, ZardTabGroupComponent } from '../tabs.component';

@Component({
  selector: 'z-demo-tabs-disabled',
  imports: [ZardTabComponent, ZardTabGroupComponent],
  standalone: true,
  template: `
    <div class="w-full max-w-md">
      <z-tab-group>
        <z-tab label="Home" />
        <z-tab label="Disabled" zDisabled />
      </z-tab-group>
    </div>
  `,
})
export class ZardDemoTabsDisabledComponent {}

icons

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

import { provideIcons } from '@ng-icons/core';
import { lucideAppWindow, lucideCode } from '@ng-icons/lucide';

import { ZardTabComponent, ZardTabGroupComponent } from '../tabs.component';

@Component({
  selector: 'z-demo-tabs-icons',
  imports: [ZardTabComponent, ZardTabGroupComponent],
  standalone: true,
  template: `
    <div class="w-full max-w-md">
      <z-tab-group>
        <z-tab label="Preview" zIcon="lucideAppWindow" />
        <z-tab label="Code" zIcon="lucideCode" />
      </z-tab-group>
    </div>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
  viewProviders: [provideIcons({ lucideAppWindow, lucideCode })],
})
export class ZardDemoTabsIconsComponent {}

API Reference

z-tab-groupComponent

A set of layered sections of content — known as tab panels — displayed one at a time.

PropertyDescriptionTypeDefault
[zVariant] Visual variant of the tab navigation 'default' | 'line' 'default'
[zOrientation] Layout direction of the tab group 'horizontal' | 'vertical' 'horizontal'
[zDisabled] Whether the entire tab group is disabled boolean false
(zTabChange) Emits when a new tab is selected $event -
(zDeselect) Emits when the current tab is deselected $event -

z-tabComponent

An individual tab. Label is shown in the navigation; projected content becomes the tab panel.

PropertyDescriptionTypeDefault
label Label displayed in the tab button string -
[zIcon] Optional ng-icons name shown before the label string -
[zDisabled] Whether this individual tab is disabled boolean false
github iconwhatsapp icondiscord iconX icon

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