vdux-transition
Transition component, analogous to React's ReactTransitionGroup
Last updated 4 years ago by ashaffer88 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vdux-transition 
SYNC missed versions from official npm registry.

transition

js-standard-style

Transition component, analogous to React's ReactTransitionGroup, but in a more declarative style.

Installation

$ npm install vdux-transition

Usage

<Transition /> injects a special $transition prop into all of its children. That prop has entering, leaving, didEnter, and didLeave. Example:

function Tooltip () {
  return (
    <Transition>
      <InnerTooltip>{props.message}</InnerTooltip>
    </Transition>
  )
}

const InnerTooltip () {
  render ({props}) {
    const {$transition} = props
    const {didEnter, didLeave, entering, leaving} = $transition

    return (
      <div class={{fade_in: entering, fade_out: leaving}} onAnimationEnd={[entering && didEnter, leaving && didLeave]}>
        {children}
      </div>
    )
  }
}

$transition prop

  • entering - Whether or not the child is currently entering
  • leaving - Whether or not the child is currently leaving
  • didEnter - Call this when your enter animation finishes
  • didLeave - Call this when your leave animation finishes

See also

  • CSSTransition - A higher-level transition component for animating classes, a la ReactCSSTransitionGroup/ngAnimate.

License

MIT

Current Tags

  • 1.1.1                                ...           latest (4 years ago)

10 Versions

  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (15)

Copyright 2014 - 2016 © taobao.org |