1.0.53 • Published 4 years ago

react-accordion-collapsible v1.0.53

Weekly downloads
-
License
ISC
Repository
-
Last release
4 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

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago