Documentation index for AI agents (llms.txt). Markdown versions of every page are available by appending .md to the page URL. The full corpus is at /llms-full.txt.

Accordion

The Accordion component shows and hides content behind a clickable title. It animates open and close, rotates its chevron to match, and respects prefers-reduced-motion.

For design guidelines and all interactive states, see the Accordions design page.

import React from "react";
import { Accordion } from "cherry-styled-components";

export default function Page() {
  return (
    <Accordion title="What is Cherry?">
      Cherry is a design system for the modern web.
    </Accordion>
  );
}

The inline variant drops the border, radius, and side padding for embedding inside cards or lists:

<Accordion title="Inline accordion" $inline>
  Content
</Accordion>

By default the accordion manages its own state. Pass open and onToggle to control it from the parent:

<Accordion title="Controlled" open={isOpen} onToggle={setIsOpen}>
  Content
</Accordion>

Properties

childrenReact.ReactNoderequired

The collapsible content.

titleReact.ReactNoderequired

The always-visible clickable title.

$inlineboolean

Removes the border, radius, and side padding for a flush, compact look.

defaultOpenboolean

Renders the accordion open initially (uncontrolled mode).

openboolean

Controlled open state. When provided, the parent owns open/close; pair it with onToggle.

onToggle(isOpen: boolean) => void

Called with the next state whenever the title is clicked.

All other standard div attributes (className, id, style, aria-*, and so on) are passed through to the root element; the native title and onToggle attributes are replaced by the props above.