item

A versatile component for displaying content with media, title, description, and actions.

PreviousNext
Basic ItemA simple item with title and description.Your profile has been verified.
import { Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideBadgeCheck, lucideChevronRight } from '@ng-icons/lucide';

import { ZardButtonComponent } from '@/shared/components/button/button.component';
import { ZardItemImports } from '@/shared/components/item/item.imports';

@Component({
  selector: 'z-demo-item-default',
  imports: [ZardButtonComponent, NgIcon, ...ZardItemImports],
  template: `
    <div class="flex w-full min-w-md flex-col gap-6">
      <z-item zVariant="outline">
        <z-item-content>
          <z-item-title>Basic Item</z-item-title>
          <z-item-description>A simple item with title and description.</z-item-description>
        </z-item-content>
        <z-item-actions>
          <button type="button" z-button zType="outline" zSize="sm">Action</button>
        </z-item-actions>
      </z-item>

      <a z-item href="#" zVariant="outline" zSize="sm">
        <z-item-media>
          <ng-icon name="lucideBadgeCheck" size="1.25rem" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Your profile has been verified.</z-item-title>
        </z-item-content>
        <z-item-actions>
          <ng-icon name="lucideChevronRight" size="1rem" />
        </z-item-actions>
      </a>
    </div>
  `,
  viewProviders: [provideIcons({ lucideBadgeCheck, lucideChevronRight })],
})
export class ZardDemoItemDefaultComponent {}

Installation

Copy
npx zard-cli@latest add item

Usage

import { ZardItemImports } from '@/shared/components/item/item.imports';
Copy
<z-item zVariant="outline">
  <z-item-content>
    <z-item-title>Title</z-item-title>
    <z-item-description>Description</z-item-description>
  </z-item-content>
</z-item>
Copy

Examples

default

Basic ItemA simple item with title and description.Your profile has been verified.
import { Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideBadgeCheck, lucideChevronRight } from '@ng-icons/lucide';

import { ZardButtonComponent } from '@/shared/components/button/button.component';
import { ZardItemImports } from '@/shared/components/item/item.imports';

@Component({
  selector: 'z-demo-item-default',
  imports: [ZardButtonComponent, NgIcon, ...ZardItemImports],
  template: `
    <div class="flex w-full min-w-md flex-col gap-6">
      <z-item zVariant="outline">
        <z-item-content>
          <z-item-title>Basic Item</z-item-title>
          <z-item-description>A simple item with title and description.</z-item-description>
        </z-item-content>
        <z-item-actions>
          <button type="button" z-button zType="outline" zSize="sm">Action</button>
        </z-item-actions>
      </z-item>

      <a z-item href="#" zVariant="outline" zSize="sm">
        <z-item-media>
          <ng-icon name="lucideBadgeCheck" size="1.25rem" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Your profile has been verified.</z-item-title>
        </z-item-content>
        <z-item-actions>
          <ng-icon name="lucideChevronRight" size="1rem" />
        </z-item-actions>
      </a>
    </div>
  `,
  viewProviders: [provideIcons({ lucideBadgeCheck, lucideChevronRight })],
})
export class ZardDemoItemDefaultComponent {}

variant

Default VariantTransparent background with no border.Outline VariantOutlined style with a visible border.Muted VariantMuted background for secondary content.
import { Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideInbox } from '@ng-icons/lucide';

import { ZardItemImports } from '@/shared/components/item/item.imports';

@Component({
  selector: 'z-demo-item-variant',
  imports: [NgIcon, ...ZardItemImports],
  template: `
    <div class="flex w-full min-w-md flex-col gap-6">
      <z-item>
        <z-item-media zVariant="icon">
          <ng-icon name="lucideInbox" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Default Variant</z-item-title>
          <z-item-description>Transparent background with no border.</z-item-description>
        </z-item-content>
      </z-item>
      <z-item zVariant="outline">
        <z-item-media zVariant="icon">
          <ng-icon name="lucideInbox" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Outline Variant</z-item-title>
          <z-item-description>Outlined style with a visible border.</z-item-description>
        </z-item-content>
      </z-item>
      <z-item zVariant="muted">
        <z-item-media zVariant="icon">
          <ng-icon name="lucideInbox" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Muted Variant</z-item-title>
          <z-item-description>Muted background for secondary content.</z-item-description>
        </z-item-content>
      </z-item>
    </div>
  `,
  viewProviders: [provideIcons({ lucideInbox })],
})
export class ZardDemoItemVariantComponent {}

size

Default SizeThe standard size for most use cases.Small SizeA compact size for dense layouts.Extra Small SizeThe most compact size available.
import { Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideInbox } from '@ng-icons/lucide';

import { ZardItemImports } from '@/shared/components/item/item.imports';

@Component({
  selector: 'z-demo-item-size',
  imports: [NgIcon, ...ZardItemImports],
  template: `
    <div class="flex w-full min-w-md flex-col gap-6">
      <z-item zVariant="outline">
        <z-item-media zVariant="icon">
          <ng-icon name="lucideInbox" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Default Size</z-item-title>
          <z-item-description>The standard size for most use cases.</z-item-description>
        </z-item-content>
      </z-item>
      <z-item zVariant="outline" zSize="sm">
        <z-item-media zVariant="icon">
          <ng-icon name="lucideInbox" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Small Size</z-item-title>
          <z-item-description>A compact size for dense layouts.</z-item-description>
        </z-item-content>
      </z-item>
      <z-item zVariant="outline" zSize="xs">
        <z-item-media zVariant="icon">
          <ng-icon name="lucideInbox" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Extra Small Size</z-item-title>
          <z-item-description>The most compact size available.</z-item-description>
        </z-item-content>
      </z-item>
    </div>
  `,
  viewProviders: [provideIcons({ lucideInbox })],
})
export class ZardDemoItemSizeComponent {}

icon

Security AlertNew login detected from unknown device.
import { Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideShieldAlert } from '@ng-icons/lucide';

import { ZardButtonComponent } from '@/shared/components/button/button.component';
import { ZardItemImports } from '@/shared/components/item/item.imports';

@Component({
  selector: 'z-demo-item-icon',
  imports: [ZardButtonComponent, NgIcon, ...ZardItemImports],
  template: `
    <div class="flex w-full min-w-lg flex-col gap-6">
      <z-item zVariant="outline">
        <z-item-media zVariant="icon">
          <ng-icon name="lucideShieldAlert" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Security Alert</z-item-title>
          <z-item-description>New login detected from unknown device.</z-item-description>
        </z-item-content>
        <z-item-actions>
          <button type="button" z-button zType="outline" zSize="sm">Review</button>
        </z-item-actions>
      </z-item>
    </div>
  `,
  viewProviders: [provideIcons({ lucideShieldAlert })],
})
export class ZardDemoItemIconComponent {}

avatar

ER Evil RabbitLast seen 5 months ago CN @shadcn LR @maxleiter ER @evilrabbitNo Team MembersInvite your team to collaborate on this project.
import { Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucidePlus } from '@ng-icons/lucide';

import { ZardAvatarComponent, ZardAvatarGroupComponent } from '@/shared/components/avatar';
import { ZardButtonComponent } from '@/shared/components/button/button.component';
import { ZardItemImports } from '@/shared/components/item/item.imports';

@Component({
  selector: 'z-demo-item-avatar',
  imports: [ZardAvatarComponent, ZardAvatarGroupComponent, ZardButtonComponent, NgIcon, ...ZardItemImports],
  template: `
    <div class="flex w-full min-w-lg flex-col gap-6">
      <z-item zVariant="outline">
        <z-item-media>
          <z-avatar zSrc="https://github.com/evilrabbit.png" zFallback="ER" class="size-10" />
        </z-item-media>
        <z-item-content>
          <z-item-title>Evil Rabbit</z-item-title>
          <z-item-description>Last seen 5 months ago</z-item-description>
        </z-item-content>
        <z-item-actions>
          <button type="button" z-button zType="outline" zSize="icon-sm" zShape="circle" aria-label="Invite">
            <ng-icon name="lucidePlus" />
          </button>
        </z-item-actions>
      </z-item>

      <z-item zVariant="outline">
        <z-item-media>
          <z-avatar-group>
            <z-avatar zSrc="https://github.com/shadcn.png" zAlt="@shadcn" zFallback="CN" class="grayscale" />
            <z-avatar zSrc="https://github.com/maxleiter.png" zAlt="@maxleiter" zFallback="LR" class="grayscale" />
            <z-avatar zSrc="https://github.com/evilrabbit.png" zAlt="@evilrabbit" zFallback="ER" class="grayscale" />
          </z-avatar-group>
        </z-item-media>
        <z-item-content>
          <z-item-title>No Team Members</z-item-title>
          <z-item-description>Invite your team to collaborate on this project.</z-item-description>
        </z-item-content>
        <z-item-actions>
          <button type="button" z-button zType="outline" zSize="sm">Invite</button>
        </z-item-actions>
      </z-item>
    </div>
  `,
  viewProviders: [provideIcons({ lucidePlus })],
})
export class ZardDemoItemAvatarComponent {}

image

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

import { ZardItemImports } from '@/shared/components/item/item.imports';

interface Song {
  title: string;
  artist: string;
  album: string;
  duration: string;
}

@Component({
  selector: 'z-demo-item-image',
  imports: [...ZardItemImports],
  template: `
    <div class="flex w-full min-w-md flex-col gap-6">
      <z-item-group class="gap-4">
        @for (song of music; track song.title) {
          <a z-item href="#" zVariant="outline" role="listitem">
            <z-item-media zVariant="image">
              <img [src]="'https://avatar.vercel.sh/' + song.title" [alt]="song.title" class="object-cover grayscale" />
            </z-item-media>
            <z-item-content>
              <z-item-title class="line-clamp-1">
                {{ song.title }} -
                <span class="text-muted-foreground">{{ song.album }}</span>
              </z-item-title>
              <z-item-description>{{ song.artist }}</z-item-description>
            </z-item-content>
            <z-item-content class="flex-none text-center">
              <z-item-description>{{ song.duration }}</z-item-description>
            </z-item-content>
          </a>
        }
      </z-item-group>
    </div>
  `,
})
export class ZardDemoItemImageComponent {
  protected readonly music: Song[] = [
    { title: 'Midnight City Lights', artist: 'Neon Dreams', album: 'Electric Nights', duration: '3:45' },
    { title: 'Coffee Shop Conversations', artist: 'The Morning Brew', album: 'Urban Stories', duration: '4:05' },
    { title: 'Digital Rain', artist: 'Cyber Symphony', album: 'Binary Beats', duration: '3:30' },
  ];
}

group

S shadcnshadcn@vercel.com M maxleitermaxleiter@vercel.com E evilrabbitevilrabbit@vercel.com
import { Component } from '@angular/core';

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucidePlus } from '@ng-icons/lucide';

import { ZardAvatarComponent } from '@/shared/components/avatar';
import { ZardButtonComponent } from '@/shared/components/button/button.component';
import { ZardItemImports } from '@/shared/components/item/item.imports';

interface Person {
  username: string;
  avatar: string;
  email: string;
}

@Component({
  selector: 'z-demo-item-group',
  imports: [ZardAvatarComponent, ZardButtonComponent, NgIcon, ...ZardItemImports],
  template: `
    <z-item-group class="min-w-sm">
      @for (person of people; track person.username) {
        <z-item zVariant="outline">
          <z-item-media>
            <z-avatar [zSrc]="person.avatar" [zFallback]="person.username.charAt(0).toUpperCase()" class="grayscale" />
          </z-item-media>
          <z-item-content class="gap-1">
            <z-item-title>{{ person.username }}</z-item-title>
            <z-item-description>{{ person.email }}</z-item-description>
          </z-item-content>
          <z-item-actions>
            <button type="button" z-button zType="ghost" zSize="icon-sm" zShape="circle">
              <ng-icon name="lucidePlus" />
            </button>
          </z-item-actions>
        </z-item>
      }
    </z-item-group>
  `,
  viewProviders: [provideIcons({ lucidePlus })],
})
export class ZardDemoItemGroupComponent {
  protected readonly people: Person[] = [
    { username: 'shadcn', avatar: 'https://github.com/shadcn.png', email: 'shadcn@vercel.com' },
    { username: 'maxleiter', avatar: 'https://github.com/maxleiter.png', email: 'maxleiter@vercel.com' },
    { username: 'evilrabbit', avatar: 'https://github.com/evilrabbit.png', email: 'evilrabbit@vercel.com' },
  ];
}

header

v0-1.5-smv0-1.5-smEveryday tasks and UI generation.v0-1.5-lgv0-1.5-lgAdvanced thinking or reasoning.v0-2.0-miniv0-2.0-miniOpen Source model for everyone.
import { Component } from '@angular/core';

import { ZardItemImports } from '@/shared/components/item/item.imports';

interface Model {
  name: string;
  description: string;
  image: string;
}

@Component({
  selector: 'z-demo-item-header',
  imports: [...ZardItemImports],
  template: `
    <div class="flex w-full min-w-xl flex-col gap-6">
      <z-item-group class="grid grid-cols-3 gap-4">
        @for (model of models; track model.name) {
          <z-item zVariant="outline">
            <z-item-header>
              <img [src]="model.image" [alt]="model.name" class="aspect-square w-full rounded-sm object-cover" />
            </z-item-header>
            <z-item-content>
              <z-item-title>{{ model.name }}</z-item-title>
              <z-item-description>{{ model.description }}</z-item-description>
            </z-item-content>
          </z-item>
        }
      </z-item-group>
    </div>
  `,
})
export class ZardDemoItemHeaderComponent {
  protected readonly models: Model[] = [
    {
      name: 'v0-1.5-sm',
      description: 'Everyday tasks and UI generation.',
      image: 'https://images.unsplash.com/photo-1650804068570-7fb2e3dbf888?q=80&w=640&auto=format&fit=crop',
    },
    {
      name: 'v0-1.5-lg',
      description: 'Advanced thinking or reasoning.',
      image: 'https://images.unsplash.com/photo-1610280777472-54133d004c8c?q=80&w=640&auto=format&fit=crop',
    },
    {
      name: 'v0-2.0-mini',
      description: 'Open Source model for everyone.',
      image: 'https://images.unsplash.com/photo-1602146057681-08560aee8cde?q=80&w=640&auto=format&fit=crop',
    },
  ];
}

link

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

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideChevronRight, lucideExternalLink } from '@ng-icons/lucide';

import { ZardItemImports } from '@/shared/components/item/item.imports';

@Component({
  selector: 'z-demo-item-link',
  imports: [NgIcon, ...ZardItemImports],
  template: `
    <div class="flex w-full min-w-md flex-col gap-4">
      <a z-item href="#">
        <z-item-content>
          <z-item-title>Visit our documentation</z-item-title>
          <z-item-description>Learn how to get started with our components.</z-item-description>
        </z-item-content>
        <z-item-actions>
          <ng-icon name="lucideChevronRight" size="1rem" />
        </z-item-actions>
      </a>

      <a z-item href="#" zVariant="outline" target="_blank" rel="noopener noreferrer">
        <z-item-content>
          <z-item-title>External resource</z-item-title>
          <z-item-description>Opens in a new tab with security attributes.</z-item-description>
        </z-item-content>
        <z-item-actions>
          <ng-icon name="lucideExternalLink" size="1rem" />
        </z-item-actions>
      </a>
    </div>
  `,
  viewProviders: [provideIcons({ lucideChevronRight, lucideExternalLink })],
})
export class ZardDemoItemLinkComponent {}

dropdown

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

import { NgIcon, provideIcons } from '@ng-icons/core';
import { lucideChevronDown } from '@ng-icons/lucide';

import { ZardAvatarComponent } from '@/shared/components/avatar';
import { ZardButtonComponent } from '@/shared/components/button/button.component';
import { ZardDropdownImports } from '@/shared/components/dropdown/dropdown.imports';
import { ZardItemImports } from '@/shared/components/item/item.imports';

interface Person {
  username: string;
  avatar: string;
  email: string;
}

@Component({
  selector: 'z-demo-item-dropdown',
  imports: [ZardAvatarComponent, ZardButtonComponent, NgIcon, ...ZardDropdownImports, ...ZardItemImports],
  template: `
    <button type="button" z-button zType="outline" z-dropdown [zDropdownMenu]="menu">
      Select
      <ng-icon name="lucideChevronDown" />
    </button>

    <z-dropdown-menu-content #menu="zDropdownMenuContent" class="w-56">
      @for (person of people; track person.username) {
        <z-dropdown-menu-item>
          <z-item zSize="xs" class="w-full p-2">
            <z-item-media>
              <z-avatar
                [zSrc]="person.avatar"
                [zFallback]="person.username.charAt(0).toUpperCase()"
                class="size-7 grayscale"
              />
            </z-item-media>
            <z-item-content class="gap-0">
              <z-item-title>{{ person.username }}</z-item-title>
              <z-item-description class="leading-none">{{ person.email }}</z-item-description>
            </z-item-content>
          </z-item>
        </z-dropdown-menu-item>
      }
    </z-dropdown-menu-content>
  `,
  viewProviders: [provideIcons({ lucideChevronDown })],
})
export class ZardDemoItemDropdownComponent {
  protected readonly people: Person[] = [
    { username: 'shadcn', avatar: 'https://github.com/shadcn.png', email: 'shadcn@vercel.com' },
    { username: 'maxleiter', avatar: 'https://github.com/maxleiter.png', email: 'maxleiter@vercel.com' },
    { username: 'evilrabbit', avatar: 'https://github.com/evilrabbit.png', email: 'evilrabbit@vercel.com' },
  ];
}

API Reference

z-itemComponent

Container for an entry composed of media, content, and actions.

PropertyDescriptionTypeDefault
[zVariant] Visual style of the item. default | outline | muted default
[zSize] Padding and density. default | sm | xs default
[class] Override or extend default classes. ClassValue -

z-item-groupComponent

Wrapper around multiple items with consistent spacing.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -

z-item-separatorComponent

Horizontal separator rendered between items in a group.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -

z-item-mediaComponent

Slot for an icon, image, or custom media at the leading edge of the item.

PropertyDescriptionTypeDefault
[zVariant] Media presentation. default | icon | image default
[class] Override or extend default classes. ClassValue -

z-item-contentComponent

Main text/content area; usually wraps title and description.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -

z-item-titleComponent

Primary heading for the item.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -

z-item-descriptionComponent

Supporting copy below the title.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -

z-item-actionsComponent

Container for trailing buttons or controls.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -

z-item-headerComponent

Optional header row rendered at the top of the item.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -

z-item-footerComponent

Optional footer row rendered at the bottom of the item.

PropertyDescriptionTypeDefault
[class] Override or extend default classes. ClassValue -
github iconwhatsapp icondiscord iconX icon

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