ui

Accordion

A set of collapsible panels with headings. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

Examples

Single Accordion

Only one panel can be open at a time. Opening a new item automatically closes the previously open one.

Multiple Accordion

Set type="multiple" to allow any number of panels to be open simultaneously.

Controlled Accordion

Manage the open state externally with value and onValueChange to drive accordion state from parent logic.

Plus/Minus Indicators

Replace the default chevron with a + / icon pair that clearly communicates the expand and collapse actions.

Bordered

Adds individual item borders and rounded corners for a card-like appearance suited to settings or FAQ sections.

In Card

Wraps the accordion inside a Card component so it inherits the card's border, padding, and background.

Nested

Demonstrates accordion items that contain a second-level accordion, each level visually indented and bordered.

With User List

Each item header shows a user avatar, name, and role badge. Expanding the item reveals additional profile details.

Changelog

Versioned release entries with a monospace version string, "Latest" and "Breaking" badges inline in the trigger, and a bullet list of color-coded change types in the panel.

Searchable FAQ

A live keyword filter input sits above the accordion. Typing narrows items by matching against both the question and the answer text, with an empty state when no results match.

Settings Navigation

Accordion used as a collapsible sidebar navigation. Each section has an icon and label in the trigger, and expands to reveal indented links with a left border rail.

Job Board Listings

Each item shows a job title, department, location, and employment-type badge in the trigger. Expanding reveals a description, requirements list, salary range, and an Apply Now button.

Onboarding Step Tracker

A controlled accordion that tracks completed steps. Finished steps display a green numbered circle with a check mark and a tinted background; clicking "Mark as complete" advances to the next step.

Product Specifications

Specification rows are grouped into collapsible categories (Display, Performance, Battery, Connectivity). Each panel renders a definition list with label and value columns.