Stacked sections for showing and hiding related content.
npx shadcn@latest add @iconiq/r-accordionimport {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/r-accordion";
export function AccordionPreview() {
return (
<Accordion defaultValue={["workflow"]} className="w-full max-w-xl">
<AccordionItem value="workflow">
<AccordionTrigger>How should I use this page?</AccordionTrigger>
<AccordionContent>
Switch libraries above. The preview, install command, and registry
files update together.
</AccordionContent>
</AccordionItem>
<AccordionItem value="api">
<AccordionTrigger>Does the public API stay the same?</AccordionTrigger>
<AccordionContent>
Yes. Both entries export the same compound parts, variants, and
multi-open behavior.
</AccordionContent>
</AccordionItem>
<AccordionItem value="install">
<AccordionTrigger>What changes when I switch providers?</AccordionTrigger>
<AccordionContent>
Only the underlying implementation and dependency list change.
</AccordionContent>
</AccordionItem>
</Accordion>
);
}valueStable identifier used by defaultValue, value, and the underlying primitive.
Type string
childrenUsually an AccordionTrigger followed by AccordionContent.
Type ReactNode
classNameMerged onto the primitive item while preserving the default or quiet row styling.
Type string
childrenTrigger text or inline content.
Type ReactNode
classNameMerged onto the trigger button after the variant's layout and focus classes.
Type string
childrenPanel content, including paragraphs, lists, links, or richer fragments.
Type ReactNode
classNameMerged onto the inner copy wrapper so text and rich content can be styled per panel.
Type string
childrenAccordionItem children rendered in display order. The legacy items prop remains supported for older installs.
Type ReactNode
defaultValueUncontrolled list of item values that should be open on first render.
Type string[]
valueControlled list of open item values. Pair with onValueChange.
Type string[]
onValueChangeCalled with the next open-value array for both Base UI and Radix UI variants.
Type (value: string[]) => void
classNameMerged onto the max-w-2xl root wrapper so you can stretch, align, or reposition the accordion in your layout.
Type string
multipleAllows multiple rows to stay open at the same time. When omitted, opening a row closes the previous one.
Type boolean·Default false
variantSwitches between the standard divided list and the quieter inline plus/minus treatment.
Type "default" | "quiet"·Default "default"
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.