Accordion

Description

Accordion is a component that is used for displaying additional information that pertains to a specific row by clicking the entire row or the arrow icon. Accordion can also be used in a multiple manner where you can select the specific accordion you want to process or manipulate.

 

System Dependencies

Installation

The package can be installed via npm:

npm install empower-display --save

Standard Accordion

 

Configuration

import { Accordion } from 'empower-display'; .............. const configAccordion = [ { title: 'Title 1', subText: 'Subtext Title 1', checked: true, show: true, content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", }, { title: 'Title 2', subText: 'Subtext Title 2', checked: false, show: false, content: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.", }, ] /** * * getActions - method that gets the value and data of the component */ const getActions = (value, data) => { console.log('VALUE', value, data) } .............. return ( <> <Accordion config={configAccordion} onChange={e => getActions(e, 'acc')} /> </> )

 Properties

Parameter

Data Type

Constraint

Description

Parameter

Data Type

Constraint

Description

config

Array

Required

Sets of data that the component will display.

title

String

Required

Main title of the row

subText

String

Required

Additional text under the title.

checked

Boolean

Optional

Sets the checkbox value if its checked or not.

show

Boolean

Optional

Sets the visibility of the checkbox from the row.

content

String/HTML

Required

The detailed text under the specific row. It can be string or HTML tags.

References

Repository Link: https://bitbucket.org/empowerteams/empower-display

NPM Package: https://www.npmjs.com/package/empower-display

Demo Repo: git@bitbucket.org:empowerteams/mfe-sub-application-template.git