React component for sliding up and down it's content.
See DEMO
- Does not depend on any external effect library (yes, NO jQuery).
- Fast animations. The effect is done with CSS3 transitions.
npm i -S react-styled-collapser
<Button onClick={this.toggle} expanded>
{this.state.collapsed ? 'Reveal' : 'Hide'}
</Button>
<Collapser collapsed={this.state.collapsed}>
...
</Collapser>
For more examples take a look into /src/docs/index.js
.
-
collapsed
(boolean) Defines current state. -
duration
(integer, default=200) Effect duration in milliseconds. -
easing
(string, default="ease") CSS3 easing function. -
collapsedHeight
(integer, default=0) Maximum height of content shown in collapsed state. -
hasCropper
(integer, default=true) Whether to show a shrinked content indicator line in half-collapsed state.