Accordion

Collapsible panels with single or multiple expansion modes and full keyboard support.

Data Display@sisyphos-ui/accordionView on npmView as Markdown

Preview

tsx

Every token is a CSS variable under `--sisyphos-*`. Override them globally or scoped to any DOM subtree.

Installation

Install the individual package:

$ pnpm add @sisyphos-ui/accordion @sisyphos-ui/core

Or use the umbrella package that bundles everything:

$ pnpm add @sisyphos-ui/ui

Usage

Import the component styles and the component itself:

snippet.tsxtsx
import "@sisyphos-ui/accordion/styles.css";
import { Accordion } from "@sisyphos-ui/accordion";

Multiple expansion

`multiple` lets several panels open at once. Pass a `string[]` to `defaultValue` / `value`.

tsx

Orders placed before 4pm ship same day. Tracking numbers arrive by email the moment a parcel leaves the warehouse.

30-day window, no questions asked. Print a prepaid label from your order page and drop it at any carrier.

Ghost variant

Borderless chrome for accordions nested inside other containers.

tsx

Use the `ghost` variant when the accordion sits inside cards or panels that already provide their own container styling.

Disabled item

Mark individual items `disabled`. The trigger stays focusable for screen readers.

tsx

Always available. Up to 3 projects.

Controlled

Sync with external state via `value` + `onValueChange`. Pass `null` to collapse all.

tsx
Active:overview

Controlled accordions let you sync the open panel with external state — URL hash, analytics, a side menu, etc.

API

Props table is being written. See the package README for the complete API surface.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README.

Was this page helpful?
Edit this page on GitHub