Groups several ImageAccordion
components together, so only one of them can be
open at a time.
You should have the chayns-components
package installed. If that is not the
case already, run
yarn add chayns-components
or
npm i chayns-components
After the chayns-components
package is installed, you can import the component
and use it with React:
import React from 'react'
import { ImageAccordionGroup } from 'chayns-components';
// ...
<ImageAccordionGroup {...} />
The ImageAccordionGroup
-component takes the following props:
Name | Type | Default | Required |
---|---|---|---|
children | ReactNode |
[] |
|
dataGroup | string |
||
className | string |
'' |
|
reference | function |
||
onHeadOpen | function |
children?: ReactNode
A list of ImageAccordion
components, that are contained in this group.
dataGroup?: string
An id that identifies this group. Accordions in groups that share the same
dataGroup
close each other.
className?: string
A classname string that will be applied to the container element.
reference?: function
A function that receives a reference to the root containers DOM node.
onHeadOpen?: function
A callback that is invoked when one of the ImageAccordion
components in this
group opens.