Client control

Accordion API

Accordion is a client-only single-open disclosure component for grouped navigation, FAQs, and docs panels.

Preview

Axonyx keeps static UI CSS-first and only hydrates interaction islands.

Import

import { Accordion, AccordionItem } from "@axonyx/react/client";

Props

PropTypeDefaultDescription
defaultValuestring | nullnullItem value opened initially.
valuestringrequired on AccordionItemStable item identifier.
titleReactNoderequired on AccordionItemTrigger content.

CSS contract

.ax-accordion
.ax-accordion__item
.ax-accordion__trigger
.ax-accordion__content
[data-open]
Single-open by design

Opening one item closes the previous one, which makes it useful for sidebars and dense docs navigation.