material-ui-animated-fab

1.0.3 • Public • Published

material-ui-animated-fab

Animated FloatingActionButton for material-ui ^0.18.1

This package provide appearing and disappearing animation of Material-UI FloatingActionButton with onDidLeave() event.

import ReactTransitionGroup from 'react-addons-transition-group'
import AnimatedFAB from 'material-ui-animated-fab'
import ContentAdd from 'material-ui/svg-icons/content/add'

let fab = ''
if (smth) {
    fab = (
        <AnimatedFAB
            key={1}
            style={style}
            onClick={handleFabClicked}
            onDidLeave={handleDidLeave}
        >
            <ContentAdd />
        </AnimatedFAB>
    )
} else if (smth2) {
    fab = (
        <AnimatedFAB
            key={2}
            style={style2}
            onClick={handleFabClicked}
            onDidLeave={handleDidLeave}
        >
            <ContentAdd />
        </AnimatedFAB>
    )
}

<ReactTransitionGroup>
    {fab}
</ReactTransitionGroup>

More extended versin of example located in example.js file in Github repo.

License

MIT license

© Alexey Shildyakov

Package Sidebar

Install

npm i material-ui-animated-fab

Weekly Downloads

4

Version

1.0.3

License

MIT

Last publish

Collaborators

  • ashl1