Accordion

Overview

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

This disclosure component is intended for interfaces that need a vertically stacked set of interactive headings that each reveal a section of content, documentation pages, and support centers. Its implementation is provided as editable source so the final behavior and styling stay inside your project.

Technologies

React
TypeScript
Tailwind CSS
shadcn/ui
Radix UI

No additional package dependency is declared for this component.

@spectrumui/accordion

Installation

Login to view commandCreate a free account to access the install command

Usage

The live preview and its Code tab above are the working example for this component. Copy the example after installation, then provide the required values from its TypeScript signature.

Props

PropTypeRequiredDescription
No shared Props typeThe installable source does not expose one shared custom prop contract. Review the exported TypeScript signatures for the individual variants shown on this page.

Use cases

  • interfaces that need a vertically stacked set of interactive headings that each reveal a section of content
  • documentation pages
  • support centers

Features

  • Copy-paste source that remains in your repository
  • TypeScript source included with the component
  • Tailwind CSS classes editable in the component source
  • shadcn/ui dependencies: accordion

Accessibility

  • The source uses Radix UI primitives for the interactions detected on this component.
  • Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.

Customization

  • Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
  • Use the documented className surface for local layout adjustments, then edit the source for structural changes.

Topic guides

See how this component fits into broader interface patterns, implementation decisions, and working examples.

Accordion FAQ

Is Accordion free to use in commercial projects?

Yes. The public Accordion source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.

How do I install Accordion?

Run npx shadcn@latest add @spectrumui/accordion. The page also exposes the source for manual installation.

Does Accordion require Motion?

No Motion dependency was detected in the documented source or registry entry for Accordion.

Does Accordion use shadcn/ui or Radix UI?

Accordion uses the accordion shadcn/ui dependencies and imports Radix UI directly.

Can I use Accordion in Next.js?

The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.

What accessibility checks should I run for Accordion?

The source includes Radix UI primitives. Test the finished interface with keyboard and screen-reader workflows.