2.9.0 • Published 8 months ago

rc-motion v2.9.0

Weekly downloads
550,947
License
MIT
Repository
github
Last release
8 months ago

rc-motion

NPM version npm download build status Codecov Dependencies DevDependencies bundle size

React lifecycle controlled motion library.

Live Demo

https://react-component.github.io/motion/

Install

rc-motion

Example

import CSSMotion from 'rc-motion';

export default ({ visible }) => (
  <CSSMotion visible={visible} motionName="my-motion">
    {({ className, style }) => <div className={className} style={style} />}
  </CSSMotion>
);

API

CSSMotion

PropertyTypeDefaultDescription
motionNamestring-Config motion name, will dynamic update when status changed
visiblebooleantrueTrigger motion events
motionAppearbooleantrueUse motion when appear
motionEnterbooleantrueUse motion when enter
motionLeavebooleantrueUse motion when leave
motionLeaveImmediatelyboolean-Will trigger leave even on mount
motionDeadlinenumber-Trigger motion status change even when motion event not fire
removeOnLeavebooleantrueRemove element when motion leave end
leavedClassNamestring-Set leaved element className
onAppearStart(HTMLElement, Event) => CSSProperties | void;-Trigger when appear start, return style will patch to element
onEnterStart(HTMLElement, Event) => CSSProperties | void;-Trigger when enter start, return style will patch to element
onLeaveStart(HTMLElement, Event) => CSSProperties | void;-Trigger when leave start, return style will patch to element
onAppearActive(HTMLElement, Event) => CSSProperties | void;-Trigger when appear active, return style will patch to element
onEnterActive(HTMLElement, Event) => CSSProperties | void;-Trigger when enter active, return style will patch to element
onLeaveActive(HTMLElement, Event) => CSSProperties | void;-Trigger when leave active, return style will patch to element
onAppearEnd(HTMLElement, Event) => boolean | void;-Trigger when appear end, will not finish when return false
onEnterEnd(HTMLElement, Event) => boolean | void;-Trigger when enter end, will not finish when return false
onLeaveEnd(HTMLElement, Event) => boolean | void;-Trigger when leave end, will not finish when return false

CSSMotionList

extends all the props from CSSMotion

PropertyTypeDefaultDescription
keysReact.Key[]-Motion list keys
componentstring | React.ComponentTypedivwrapper component

Development

npm install
npm start

License

rc-motion is released under the MIT license.

rc-triggersignplsignpl-testgron-uiradom-uiebd-test@voplus/antd@cliffdotai/atomiconlinex-test@dibanka/demokitty-designxqshoutenn-ui@baolq/antdguree-uisia-antd@everything-registry/sub-chunk-2535dt-libraryintelligent-design@hz-iris/components@infinitebrahmanuniverse/nolb-rc-@gotrip/uikit@imarabinda/antd@matthrew/x-design@marrow/fish@lowdefy/blocks-antd@lotus-design/segmented@lincy/static-style-extract@juhovalkonen/antd@moezx/antd@nicecode/meta@ktnexr/neb-ui@jxfe-ui/react@lidakai/antd@madccc/antd@lvchanglong/antd@menuzen/ui@lockerpm/design@greenatom/antd@mxcins/components@vs-new/antd@sps-components/antd4@stoneatom/components@sim-design/questionnaire@unionfab/ufc-componets@tubui/cr@pf-ui/pf-ui-react@poscredit/plugin-chart-boris@whalecloud/wcap@wii/dumi-theme-wau@rorschachyu/ethui@nouzbe/rc-menu@rc-component/trigger@readyio/design@reactizard/plain-ui@koding-cl/react-kit@kubed/components@jnoodle/antd@parallel-line/web@para-ui/core@ryozm/antd@sensoro-design/antd@yatping/antdacinguiux-ds-react-frameworkacudaduieven-antdabc-antd@unionfab/ufc-vis-components@treelab/panda@tnt-temp/tntd@subwallet/react-ui@topthink/common@yizhou-library/core@tddc/rule-condition@tddc/virtual-cascader@superset-plugins-sm/superset-plugin-chart-hello-world@sweet7/antd@sweet7/rc-select@tiddh/brave-react@toy-box/header-bar@toy-box/toybox-lib@toy-box/toybox-ui@toughou/antd@titaui/rc-tree@titaui/rc-tree2@titaui/rc-trigger@tinper/next-share@tinper/next-ui@wuxh/dumi@wuxh/antdantd-zjkantd-with-accessible-treeantd-x4antd-xijingantdsciiantdwqwqantd4-xantd5_compatible4ant_est_and_yhbantd-fx67ll-test
2.9.0

8 months ago

2.8.0

8 months ago

2.7.0

1 year ago

2.7.2

1 year ago

2.7.1

1 year ago

2.7.3

1 year ago

2.6.3

1 year ago

2.6.1

2 years ago

2.6.2

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.5.1

2 years ago

2.4.7

2 years ago

2.4.6

2 years ago

2.4.9

2 years ago

2.4.8

2 years ago

2.4.5

2 years ago

2.4.4

3 years ago

2.4.3

3 years ago

2.4.2

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.4

3 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.1.2

4 years ago

2.2.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

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