Skip to content
A simple accordion using react hooks 🤪
JavaScript HTML
Branch: master
Clone or download
gokulkrishh Merge pull request #5 from gokulkrishh/dependabot/npm_and_yarn/handle…
…bars-4.1.2

Bump handlebars from 4.1.0 to 4.1.2
Latest commit be8da4b Aug 27, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
example
tests
.babelrc
.editorconfig
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
index.js
jest.config.js
package.json
webpack.development.config.js
webpack.production.config.js
yarn.lock

README.md

react-hooks-accordion Build Status

A simple accordion made out of react hooks.

table-of-contents

Installation:

npm install react-hooks-accordion
yarn add react-hooks-accordion

Dependency:

react@16.8.1
react-dom@16.8.1

Usage:

import React from 'react'
import { render } from 'react-dom'
import Accordion from 'react-hooks-toggled'

render(
  <Accordion title="Accordion Title" onToggle={(visible) => { alert(`Accordion is ${visible}`) }}>
    <ul>
      <li>
        <span>Hello</span>
      </li>
      <li>
        <span>How are you</span>
      </li>
      <li>
        <span>I am good</span>
      </li>
    </ul>
  </Accordion>,
  document.getElementById('root'),
)

Props:

Title:

Type: string

Children:

Type: any

onToggle: Callback when we toggle the accordion.

Type: function

Argument: boolean

Development:

npm start
yarn start

Build:

npm run build
yarn run build

MIT Licensed

You can’t perform that action at this time.