PrimitivesAccordion
Accordion
Native details and summary disclosures that work with keyboard and touch.
Accordion ships with a full API table, a copyable example, and accessibility notes.
tsx
How does streaming work?
Text arrives as incremental chunks while the request is active.
Can I stop a response?
Yes. Stop cancels the active request.
Installation
Install the package once, then import Accordion from its direct entry point or from the root.
bash
pnpm add @agent-ui/reacttsx
import { Accordion } from "@agent-ui/react/accordion";Tailwind CSS v4 users: add @source "../node_modules/@agent-ui/react/src" to the global stylesheet so the library utilities are generated.
Usage
The example below is the same code that renders the preview. Copy it, swap in your own handlers, and ship.
tsx
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@agent-ui/react"; <Accordion> <AccordionItem> <AccordionTrigger>More details</AccordionTrigger> <AccordionContent>The answer goes here.</AccordionContent> </AccordionItem></Accordion>API reference
Every prop Accordion accepts, its type, default, and behaviour.
| Name | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | AccordionItem sections. |
Accessibility
Uses native details and summary elements for keyboard and assistive technology support.
Use it with the rest of the library
Accordion composes with MessageList, ChatShell, useChat, and the provider compose blocks. Browse the full reference or see all components in the gallery.
8 lines · copy-ready