Accordion

Vertically stacked set of interactive headings that reveal or hide associated content sections

Preview

Installation

npx shadcn@latest add @cubby-ui/accordion

Usage

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/cubby-ui/accordion";
<Accordion>
  <AccordionItem>
    <AccordionTrigger />
    <AccordionContent />
  </AccordionItem>
</Accordion>

Examples

Multiple Open Items

Allow multiple accordion items to be open simultaneously.

Default Expanded

Set accordion items to be expanded by default.

Follow these steps to install and configure our software:

  1. Download the latest version from our website
  2. Run the installer with administrator privileges
  3. Configure your initial settings
  4. Verify the installation was successful

Disabled Items

Disable specific accordion items to prevent interaction.

Chevron Indicator

Use chevron icons as expand/collapse indicators.

Indicator at Start

Position the expand/collapse indicator at the start of the trigger.

Without Indicator

Hide the expand/collapse indicator for a minimal design.

With Icon

Add custom icons to accordion triggers.

With Subtitle

Include descriptive subtitles in accordion triggers.

Outline Variant

Display accordion with outline styling.

Split Variant

Use split styling for separated accordion items.

Isolated Bordered Variant

Apply bordered styling to isolated accordion items.

Isolated Filled Variant

Use filled background styling for isolated items.

Isolated Filled Bordered Variant

Combine filled background with borders for isolated items.

Nested Variant

Create nested accordion structures with indentation.

API Reference

The Accordion component is built on top of Base UI's Accordion. All Base UI props are supported. The documentation below only covers custom props and modified defaults specific to our implementation.

For the complete Base UI API, see the Base UI Accordion documentation.

Custom Props

Accordion

Prop

AccordionTrigger

Prop

Modified Defaults

Our implementation changes the following Base UI prop default:

  • Accordion: multiple defaults to false (Base UI doesn't set a default)