Accordion
defaultOpen takes the indexes of initially open panels; multiple allows more than one
open at once.
All 91 components and the theme system.
import { Accordion } from '@gg-software/ui';
<Accordion
multiple
defaultOpen={[0]}
items={[
{ title: 'What is included?', content: <IncludedList /> },
{ title: 'Can I use my own colors?', content: <ThemingAnswer /> },
{ title: 'Disabled section', content: '—', disabled: true },
]}
/>;Props
| Prop | Type | Default | Description |
|---|---|---|---|
items* | AccordionItem[] | — | |
multiple | boolean | false | allow multiple panels open at once |
defaultOpen | number[] | [] | |
className | string | — |
* required · generated from packages/ui/src/containers/Accordion/Accordion.tsx
Types
type AccordionItem = {
title: ReactNode;
content: ReactNode;
disabled?: boolean;
};