shadcn-templ 2.0 beta. Switch to templUI v1
1.7k

Accordion

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

We offer standard (5-7 days), express (2-3 days), and overnight shipping. Free shipping on international orders.

package examples import "github.com/axadrn/shadcn-templ/v2/components/accordion"

Installation

shadcn-templ add accordion

Usage

import "github.com/axadrn/shadcn-templ/v2/components/accordion"
@accordion.Accordion() {	@accordion.Item(accordion.ItemProps{Open: true}) {		@accordion.Trigger() {			Is it accessible?		}		@accordion.Content() {			Yes. It adheres to the WAI-ARIA design pattern.		}	}}

Composition

Use the following composition to build an Accordion:

accordion.Accordion├── accordion.Item│   ├── accordion.Trigger│   └── accordion.Content└── accordion.Item    ├── accordion.Trigger    └── accordion.Content

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.

package examples import "github.com/axadrn/shadcn-templ/v2/components/accordion"

DisableOpenMultiple

Use the DisableOpenMultiple prop 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.

package examples import "github.com/axadrn/shadcn-templ/v2/components/accordion"

Disabled

Use the Disabled prop on accordion.Item to disable individual items.

package examples import "github.com/axadrn/shadcn-templ/v2/components/accordion"

Borders

Add border to the Accordion and border-b last:border-b-0 to the accordion.Item 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.

package examples import "github.com/axadrn/shadcn-templ/v2/components/accordion"

Card

Wrap the Accordion in a Card component.

Subscription & Billing
Common questions about your account, plans, payments and cancellations.

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.

package examples import (

API Reference

Accordion

The Accordion component is the root container that manages which items are open.

Prop Type Default
DisableOpenMultiple bool false
Class string -

Item

The accordion.Item component wraps a single trigger and content pair.

Prop Type Default
Open bool false
Disabled bool false
Class string -

Trigger

The accordion.Trigger component toggles its item open and closed.

Prop Type Default
Class string -

Content

The accordion.Content component holds the content revealed by the trigger.

Prop Type Default
Class string -