apeman-react-accordion

apeman react package for accordion components.

Stats

StarsIssuesVersionUpdatedCreatedSize
apeman-react-accordion
4.0.75 years ago6 years agoMinified + gzip package size for apeman-react-accordion in KB

Readme

apeman-react-accordion

Build Status Code Climate Code Coverage npm Version JS Standard

apeman react package for accordion components.

Installation

$ npm install apeman-react-accordion --save

Demo

Live demo is hosted on GitHub Pages.

Usage

'use strict'

import React from 'react'
import {
  ApAccordion,
  ApAccordionHeader,
  ApAccordionBody,
  ApAccordionStyle
}from 'apeman-react-accordion'

const ExampleComponent = React.createClass({
  getInitialState () {
    return {
      open: false
    }
  },
  onToggle () {
    const s = this
    s.setState({
      open: !s.state.open
    })
  },
  render () {
    const s = this
    let {state} = s
    return (
      <div>
        <ApAccordionStyle/>
        <ApAccordion open={ state.open }>
          <ApAccordionHeader onToggle={ s.onToggle }>
            <a>This is Header text.</a>
          </ApAccordionHeader>
          <ApAccordionBody>
            <span>This is Body text</span>
          </ApAccordionBody>
        </ApAccordion>
      </div>
    )
  }
})

Components

ApAccordionArrow

Props

Name Type Default Description
icon string 'fa fa-chevron-down'

ApAccordionBody

Props

Name Type Default Description

ApAccordionHeader

Props

Name Type Default Description
onToggle func null
busyDuration number 500

ApAccordionStyle

Props

Name Type Default Description

ApAccordion

Props

Name Type Default Description
open bool

License

This software is released under the MIT License.

Links

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.