1.5.10 • Published 4 years ago

react-collapser v1.5.10

Weekly downloads
378
License
MIT
Repository
github
Last release
4 years ago

🏄‍♂️ React-Collapser

Easy, fast and lightweight React collapse component for your <App />
Fully controlled, zero dependencies, works out of the box, has advanced features.
Made with functional components, hooks and latest React.

npm bundle size Build Status David   Storybook

Install

yarn add react-collapser
npm i react-collapser

Usage

import * as React from 'react'
import { Collapser, Trigger, Panel } from 'react-collapser'

<Collapser>
  <Trigger>About dogs</Trigger>
  <Panel>
    A dog is a type of domesticated animal. Known for its
    loyalty and faithfulness, it can be found as a welcome guest
    in many households across the world.
  </Panel>
</Collapser>

If you need default styles for collapser:

import 'react-collapser/dist/default-styles.css'

All possible variations of use on storybook

Why

Average size of most popular accordion packages are between 6.9 - 44.3kb (minified).
Most of their features are not in demand. Made with oldfashion classes.

Examples

react-collapser demo

Features

API

Collapser

PropertyDescriptionTypeDefault
alwaysOpenCollapser have first always opened panelBooleanfalse
alwaysOpenCollapser have one always opened panelNumber0
revealReveal all nested panels and triggersBooleanfalse
controlledCollpaser becomes fully controlled by this propBooleanfalse
animatedInitiate default animationBooleanfalse
disabledDisable whole collapserBooleanfalse
onChangeReturn state of collapserEvent{activeIndex}

Trigger / Panel

PropertyDescriptionTypeDefault
controlledPanel or Trigger component becomes fully controlledBooleanfalse
disabledDisable Trigger and linked to this Panel componentBooleanfalse

 


 

Development

yarn start - run Storybook for development on http://localhost:7000

yarn build - run Rollup to compile production build
yarn build-story - build Storybook for development

Made with:
https://github.com/toastyboost/storybook-starter
https://github.com/toastyboost/rollup-boilerplate

TODO

  • add tests
  • add typescript
  • resolve case with childs between trigger and panel
  • link features and story book
  • add gifs to most important features
  • add star motivation
  • add knobs
  • remove antd
  • add Docs addon to storybook
  • add labels in titles to duplicate states
  • add links from props table to storybook
  • add eslint ignore
  • auto copy styles to dist while build
1.5.10

4 years ago

1.5.9

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.12

4 years ago

1.3.11

4 years ago

1.3.10

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.14

4 years ago

1.2.12

4 years ago

1.2.11

4 years ago

1.2.10

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.1.3

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