Skip to content

Latest commit

 

History

History
97 lines (64 loc) · 1.84 KB

image-accordion-group.md

File metadata and controls

97 lines (64 loc) · 1.84 KB

ImageAccordionGroup

Source

Groups several ImageAccordion components together, so only one of them can be open at a time.

Usage

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 {...} />

Props

The ImageAccordionGroup-component takes the following props:

Name Type Default Required
children ReactNode []
dataGroup string
className string ''
reference function
onHeadOpen function

children

children?: ReactNode

A list of ImageAccordion components, that are contained in this group.


dataGroup

dataGroup?: string

An id that identifies this group. Accordions in groups that share the same dataGroup close each other.


className

className?: string

A classname string that will be applied to the container element.


reference

reference?: function

A function that receives a reference to the root containers DOM node.


onHeadOpen

onHeadOpen?: function

A callback that is invoked when one of the ImageAccordion components in this group opens.