CollapseGroup

A group of disclosures.

Pass several Collapse elements; joined connects their appearance. With name the group works as an accordion: only one item stays open, and the other one closes with animation.

Live example

One
Two
Three
Four
Five

Example controls

Usage

import { Collapse, CollapseGroup } from '@prosazhin/pbcomponents';

<CollapseGroup name='sections'>
  {['One', 'Two', 'Three', 'Four', 'Five'].map((item) => (
    <Collapse
      key={item}
      summary={item}
    >{`Content for ${item}`}</Collapse>
  ))}
</CollapseGroup>;

Component API

PropType / variantsPurposeDefault
childrenCollapse[]Expandable sections in the group.—
joinedbooleanJoins sections into one block.false
namestringWith name only one item stays open (accordion); the other one closes with animation.—
classNamestringClass of the root element.—

Native HTML attributes are accepted where the component renders the corresponding element. className props only affect styling.