Skip to main content

DisclosureGroup


Example

Item 1
Item 1.1
Item 1.2
Item 2
Item 3
<DisclosureGroup
items={[
{
title: "Item 1",
initialIsOpen: true,
items: [
{
title: "Item 1.1",
children: <Placeholder />,
initialIsOpen: true,
},
{
title: "Item 1.2",
children: <Placeholder />,
},
],
},
{
title: "Item 2",
children: <Placeholder />,
},
{
title: "Item 3",
items: [
{
title: "Item 3.1",
children: <Placeholder />,
},
],
},
]}
></DisclosureGroup>

Props

NameTypeDefault ValueRequiredDescription
iconPosition"leading" | "trailing"No
items(Pick<{ title: string; level?: 1 | 2; children: Children; iconPosition?: "leading" | "trailing"; } & { isOpen: boolean; onToggle: (isOpen: boolean) => void; initialIsOpen?: never; }, "title" | ... 3 more ... | "initialIsOpen"> | Pick<...> | NodeItem)[]Yes
dividersbooleanNo

Also known as

This component may also be known in other UI libraries as Accordion

Related components