Disclosure Group aka Accordion
Disclosure Group is a vertical stack of headers that expand or collapse to show or hide content, providing an organized, user-friendly way to manage information.
Basic
An disclosure functions as a vertical stack of headers that expand to reveal or conceal content sections.
Installation
If you hit any issues, make sure you check out the installation guide here.
Manual Installation
Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.
Anatomy
Import the components and use them as shown below, adapting the structure to fit each component.
Default Expanded
Set the initially expanded sections by providing an array of keys to the defaultExpandedKeys
prop. These keys can be either numbers or strings.
Allow Multiple Expanded
Allow multiple sections to be expanded at once by using the allowsMultipleExpanded
prop.
Border Hidden
Eliminate the border between sections by using the hideBorder
prop.
Hide Indicator
Eliminate the visual indicator (arrow key) by using the hideIndicator
prop.
Hide Everything
You may want to hide the entire disclosure attribute like border or indicator. You can do that by using the hideBorder
and hideIndicator
props.
Disabled
You can disabled specific sections by using the isDisabled
props to the item.