1.0.53 • Published 3 years ago

react-accordion-collapsible v1.0.53

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

React Accordion Collapsible

A simple, clean, responsive and highly customizable accordion component for React projects. Does not require the downloading of any external dependencies.

react-accordion-collapsible

Installing

npm install react-accordion-collapsible

Using the package

import React from 'react'
import { Accordion } from 'react-accordion-collapsible'

const Example = () => {
    return (
        <Accordion
            title="Example title for React Accordion Collapsible"
            content="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"
        />
    )
}

export default Example

Examples

Check out some usage examples in the /examples folder

Props

propisRequireddefaulttypedescription
idno-numberunique id
titleyes-stringtitle of the accordion
contentyes-stringtext content of the accordion
wrap-falsebooleanwhether to wrap the accordion or let it take full width of parent(default)
defaultOpen-falsebooleanshould the accordion be opened(expanded) by default
expandIcon-+ReactElementReact element to replace the default expand icon (+)
collapseIcon--ReactElementReact element to replace the default collapse icon (-)
animation-truebooleanwhether to animate the opening and closing of the accordion
animationDuration-0.25number or stringthe animation duration
children--ReactNodechildren of the component, if it is not defined as self closing
reverseIconPosition-falsebooleanreverse the expand and collapse icons positions to left side
iconSize-16numbersize of expand and collapse icons
onClick--functionfunction called when the accordion is clicked
onExpand--functionfunction called when the accordion is opened
onCollapse--functionfunction called when the accordion is closed
activeTitleColor-#22242Estringcolor of the title when accordion is opened
contentCharLimit-nullnumbermaximum length of the content

Github Repository

github.com/yatish1606/react-accordion-collapsible

Customizing the UI

Every UI layer exposes a className property for that HTML element. You can directly include styles for required element in your index.css file or component.css.

1.0.53

3 years ago

1.0.52

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.49

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.45

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.39

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago