accordion

A vertically stacked set of interactive headings that each reveal a section of content.

PreviousNext
We offer standard (5-7 days), express (2-3 days), and overnight shipping. Free shipping on international orders.
Returns accepted within 30 days. Items must be unused and in original packaging. Refunds processed within 5-7 business days.
Reach us via email, live chat, or phone. We respond within 24 hours during business days.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { ZardAccordionImports } from '@/shared/components/accordion/accordion.imports';

@Component({
  selector: 'z-demo-accordion-preview',
  imports: [ZardAccordionImports],
  template: `
    <z-accordion zDefaultValue="returns" zType="single" class="max-w-sm">
      <z-accordion-item zValue="shipping" zTitle="What are your shipping options?">
        We offer standard (5-7 days), express (2-3 days), and overnight shipping. Free shipping on international orders.
      </z-accordion-item>

      <z-accordion-item zValue="returns" zTitle="What is your return policy?">
        Returns accepted within 30 days. Items must be unused and in original packaging. Refunds processed within 5-7
        business days.
      </z-accordion-item>

      <z-accordion-item zValue="support" zTitle="How can I contact customer support?">
        Reach us via email, live chat, or phone. We respond within 24 hours during business days.
      </z-accordion-item>
    </z-accordion>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoAccordionPreviewComponent {}

Installation

Copy
npx zard-cli@latest add accordion

Usage

import { ZardAccordionImports } from '@/shared/components/accordion/accordion.imports';
Copy
<z-accordion zType="single" zCollapsible>
  <z-accordion-item zValue="item-1" zTitle="Is it accessible?">
    Yes. It adheres to the WAI-ARIA design pattern.
  </z-accordion-item>
</z-accordion>
Copy

Examples

basic

A basic accordion that shows one item at a time. The first item is open by default.

Click on 'Forgot Password' on the login page, enter your email address, and we'll send you a link to reset your password. The link will expire in 24 hours.
Yes, you can upgrade or downgrade your plan at any time from your account settings. Changes will be reflected in your next billing cycle.
We accept all major credit cards, PayPal, and bank transfers. All payments are processed securely through our payment partners.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { ZardAccordionImports } from '@/shared/components/accordion/accordion.imports';

@Component({
  selector: 'z-demo-accordion-basic',
  imports: [ZardAccordionImports],
  template: `
    <z-accordion zDefaultValue="item-1" zType="single" class="max-w-sm">
      <z-accordion-item zValue="item-1" zTitle="How do I reset my password?">
        Click on 'Forgot Password' on the login page, enter your email address, and we'll send you a link to reset your
        password. The link will expire in 24 hours.
      </z-accordion-item>

      <z-accordion-item zValue="item-2" zTitle="Can I change my subscription plan?">
        Yes, you can upgrade or downgrade your plan at any time from your account settings. Changes will be reflected in
        your next billing cycle.
      </z-accordion-item>

      <z-accordion-item zValue="item-3" zTitle="What payment methods do you accept?">
        We accept all major credit cards, PayPal, and bank transfers. All payments are processed securely through our
        payment partners.
      </z-accordion-item>
    </z-accordion>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoAccordionBasicComponent {}

multiple

Use type="multiple" to allow multiple items to be open at the same time.

Manage how you receive notifications. You can enable email alerts for updates or push notifications for mobile devices.
Control your privacy settings and security preferences. Enable two-factor authentication, manage connected devices, review active sessions, and configure data sharing preferences. You can also download your data or delete your account.
View your current plan, payment history, and upcoming invoices. Update your payment method, change your subscription tier, or cancel your subscription.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { ZardAccordionImports } from '@/shared/components/accordion/accordion.imports';

@Component({
  selector: 'z-demo-accordion-multiple',
  imports: [ZardAccordionImports],
  template: `
    <z-accordion zType="multiple" class="max-w-sm">
      <z-accordion-item zValue="notifications" zTitle="Notification Settings">
        Manage how you receive notifications. You can enable email alerts for updates or push notifications for mobile
        devices.
      </z-accordion-item>

      <z-accordion-item zValue="privacy" zTitle="Privacy & Security">
        Control your privacy settings and security preferences. Enable two-factor authentication, manage connected
        devices, review active sessions, and configure data sharing preferences. You can also download your data or
        delete your account.
      </z-accordion-item>

      <z-accordion-item zValue="billing" zTitle="Billing & Subscription">
        View your current plan, payment history, and upcoming invoices. Update your payment method, change your
        subscription tier, or cancel your subscription.
      </z-accordion-item>
    </z-accordion>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoAccordionMultipleComponent {}

disabled

Use the disabled prop on AccordionItem to disable individual items.

Click on 'Forgot Password' on the login page, enter your email address, and we'll send you a link to reset your password. The link will expire in 24 hours.
We accept all major credit cards, PayPal, and bank transfers. All payments are processed securely through our payment partners.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { ZardAccordionImports } from '@/shared/components/accordion/accordion.imports';

@Component({
  selector: 'z-demo-accordion-disabled',
  imports: [ZardAccordionImports],
  template: `
    <z-accordion zType="single" class="max-w-sm">
      <z-accordion-item zValue="item-1" zTitle="Can I access my account history?">
        Click on 'Forgot Password' on the login page, enter your email address, and we'll send you a link to reset your
        password. The link will expire in 24 hours.
      </z-accordion-item>

      <z-accordion-item zValue="item-2" zTitle="Can I change my subscription plan?" [zDisabled]="true">
        Yes, you can upgrade or downgrade your plan at any time from your account settings. Changes will be reflected in
        your next billing cycle.
      </z-accordion-item>

      <z-accordion-item zValue="item-3" zTitle="What payment methods do you accept?">
        We accept all major credit cards, PayPal, and bank transfers. All payments are processed securely through our
        payment partners.
      </z-accordion-item>
    </z-accordion>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoAccordionDisabledComponent {}

borders

Add border to the Accordion and border-b last:border-b-0 to the AccordionItem to add borders to the items.

We offer monthly and annual subscription plans. Billing is charged at the beginning of each cycle, and you can cancel anytime. All plans include automatic backups, 24/7 support, and unlimited team members.
Yes. We use end-to-end encryption, SOC 2 Type II compliance, and regular third-party security audits. All data is encrypted at rest and in transit using industry-standard protocols.
We integrate with 500+ popular tools including Slack, Zapier, Salesforce, HubSpot, and more. You can also build custom integrations using our REST API and webhooks.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { ZardAccordionImports } from '@/shared/components/accordion/accordion.imports';

@Component({
  selector: 'z-demo-accordion-borders',
  imports: [ZardAccordionImports],
  template: `
    <z-accordion zDefaultValue="billing" zType="single" class="max-w-sm rounded-lg border">
      <z-accordion-item zValue="billing" zTitle="How does billing work?" class="px-4">
        We offer monthly and annual subscription plans. Billing is charged at the beginning of each cycle, and you can
        cancel anytime. All plans include automatic backups, 24/7 support, and unlimited team members.
      </z-accordion-item>

      <z-accordion-item zValue="security" zTitle="Is my data secure?" class="px-4">
        Yes. We use end-to-end encryption, SOC 2 Type II compliance, and regular third-party security audits. All data
        is encrypted at rest and in transit using industry-standard protocols.
      </z-accordion-item>

      <z-accordion-item zValue="integration" zTitle="What integrations do you support?" class="px-4">
        We integrate with 500+ popular tools including Slack, Zapier, Salesforce, HubSpot, and more. You can also build
        custom integrations using our REST API and webhooks.
      </z-accordion-item>
    </z-accordion>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoAccordionBordersComponent {}

Card

Wrap the Accordion in a Card component.

We offer three subscription tiers: Starter ($9/month), Professional ($29/month), and Enterprise ($99/month). Each plan includes increasing storage limits, API access, priority support, and team collaboration features.
Billing occurs automatically at the start of each billing cycle. We accept all major credit cards, PayPal, and ACH transfers for enterprise customers. You'll receive an invoice via email after each payment.
You can cancel your subscription anytime from your account settings. There are no cancellation fees or penalties. Your access will continue until the end of your current billing period.
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { ZardAccordionImports } from '@/shared/components/accordion/accordion.imports';
import { ZardCardComponent } from '@/shared/components/card';

@Component({
  selector: 'z-demo-accordion-card',
  imports: [ZardAccordionImports, ZardCardComponent],
  template: `
    <z-card
      zTitle="Subscription & Billing"
      zDescription="Common questions about your account, plans, payments and cancellations."
      class="w-full max-w-sm"
    >
      <z-accordion zDefaultValue="plans" zType="single">
        <z-accordion-item zValue="plans" zTitle="What subscription plans do you offer?">
          We offer three subscription tiers: Starter ($9/month), Professional ($29/month), and Enterprise ($99/month).
          Each plan includes increasing storage limits, API access, priority support, and team collaboration features.
        </z-accordion-item>

        <z-accordion-item zValue="billing" zTitle="How does billing work?">
          Billing occurs automatically at the start of each billing cycle. We accept all major credit cards, PayPal, and
          ACH transfers for enterprise customers. You'll receive an invoice via email after each payment.
        </z-accordion-item>

        <z-accordion-item zValue="cancel" zTitle="How do I cancel my subscription?">
          You can cancel your subscription anytime from your account settings. There are no cancellation fees or
          penalties. Your access will continue until the end of your current billing period.
        </z-accordion-item>
      </z-accordion>
    </z-card>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ZardDemoAccordionCardComponent {}

API Reference

z-accordionComponent

A component that displays a list of collapsible content sections.

PropertyDescriptionTypeDefault
[class] Custom CSS classes string ''
[zType] Single or multiple items can be opened 'single' | 'multiple' 'single'
[zCollapsible] Whether accordion items can be collapsed boolean true
[zDefaultValue] Item value(s) of the accordion's item(s) to be opened by default string | string[] ''

z-accordion-itemComponent

Represents a single section in the accordion.

PropertyDescriptionTypeDefault
[class] Custom CSS classes string ''
[zTitle] The title for item header string ''
[zValue] Unique value of the accordion item string ''
[zDisabled] Accordion disabled state boolean false
github iconwhatsapp icondiscord iconX icon

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