Gathering detailed insights and metrics for rc-tween-one
Gathering detailed insights and metrics for rc-tween-one
npm install rc-tween-one
Typescript
Module System
Min. Node Version
Node Version
NPM Version
91.7
Supply Chain
94
Quality
77.7
Maintenance
100
Vulnerability
98.4
License
TypeScript (56.39%)
JavaScript (43.59%)
Less (0.02%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
8,267,144
Last Day
8,604
Last Week
54,438
Last Month
205,447
Last Year
1,618,423
MIT License
382 Stars
535 Commits
32 Forks
17 Watchers
7 Branches
29 Contributors
Updated on Jan 11, 2025
Minified
Minified + Gzipped
Latest Version
3.0.6
Package Id
rc-tween-one@3.0.6
Unpacked Size
74.87 kB
Size
15.42 kB
File Count
49
NPM Version
6.14.16
Node Version
14.19.1
Cumulative downloads
Total Downloads
Last Day
8.6%
8,604
Compared to previous day
Last Week
45.6%
54,438
Compared to previous week
Last Month
-1%
205,447
Compared to previous month
Last Year
28.1%
1,618,423
Compared to previous year
3
React TweenOne Component
![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|
IE 10+ ✔ | Chrome 31.0+ ✔ | Firefox 31.0+ ✔ | Opera 30.0+ ✔ | Safari 7.0+ ✔ |
npm install
npm start
http://localhost:8100/examples/
2.x: http://react-component.github.io/tween-one/
3.x: https://tween-one.vercel.app/
1var TweenOne = require('rc-tween-one'); 2var React = require('react'); 3React.render(<TweenOne animation={{x:100}}> 4 demo 5</TweenOne>, container);
1var TweenOne = require('rc-tween-one'); 2var React = require('react'); 3var SvgDrawPlugin = require('rc-tween-one/lib/plugin/SvgDrawPlugin'); 4TweenOne.plugins.push(SvgDrawPlugin); 5React.render(<svg width="600" height="600"> 6 <TweenOne 7 animation={{ SVGDraw:'50%'}} 8 d="M0,0L100,0" 9 style={{ fill: 'none', strokeWidth: 20, stroke: '#00000' }} 10 component="path" 11 /> 12</svg>, container);
1var TweenOne = require('rc-tween-one'); 2var React = require('react'); 3var TweenOneGroup = TweenOne.TweenOneGroup; 4React.render(<TweenOneGroup> 5 <div key="0">demo</div> 6 <div key="1">demo</div> 7</TweenOneGroup>, container);
name | type | default | description |
---|---|---|---|
animation | object / array | null | animate configure parameters |
paused | boolean | false | animate timeline pause |
reverse | boolean | false | animate timeline revers |
delay | number | 0 | animate timeline delay |
repeat | number | 0 | animation all data repeat, To repeat indefinitely, use -1 |
repeatDelay | number | 0 | animate timeline repeat delay |
yoyo | boolean | false | animation all data alternating backward and forward on each repeat. |
onChange | func | null | when the animation change called, callback({ moment, targets, index, mode, ratio, vars, index, repeat }) |
onChangeTimeline | func | null | when the animation change called, callback({ mode, targets, vars, moment, totalTime, repeat }) |
moment | number | null | set the current frame |
regionStartTime | number | 0 | Set the start time of the animation region |
regionEndTime | number | null | Set the end time of the animation region |
attr | boolean | false | attribute animation is true , when morph SVG must be true . |
resetStyle | boolean | false | update animation data, reset init style |
component | string / React.Element | div | component tag |
componentProps | object | null | component is React.Element, component tag props, not add style |
Basic animation param. please view animation terms
name | type | default | description |
---|---|---|---|
[key: string] | string number array | null | All variables based on number, such as left, x, color, shadow |
type | string | to | play type: to from set |
duration | number | 450 | animate duration |
delay | number | 0 | animate delay |
repeat | number | 0 | animate repeat, To repeat indefinitely, use -1 |
repeatDelay | number | 0 | repeat start delay |
appearTo | number | null | Add to the specified time |
yoyo | boolean | false | true : alternating backward and forward on each repeat. |
ease | string | easeInOutQuad | animate ease refer or svg path M0,100 C30,60 0,20 50,50 C70,70 60,0 100,0 |
bezier | object | null | bezier curve animate |
onStart | func | null | A function that should be called when the tween begins, callback(e), e: { index, target } |
onUpdate | func | null | A function that should be called every time the animate updates, callback(e), e: { index, targets, ratio } |
onComplete | func | null | A function that should be called when the animate has completed, callback(e), e: { index, targets } |
onRepeat | func | null | A function that should be called each time the animate repeats, callback(e), e: { index, targets } |
Cannot be used at the same time
reverse
andrepeat: -1
.
1<TweenOne animation={[{ x: 100 }, { y: 100 }]} />
1import { Plugins } from 'rc-tween-one'; 2import SvgDrawPlugin from 'rc-tween-one/es/plugin/SvgDrawPlugin'; 3Plugins.push(SvgDrawPlugin); 4 5<TweenOne animation={{ SVGDraw: '10%' }} />
SVGDraw = string or number;
{ SVGDraw: 30 } or { SVGDraw: 'start end' } start and end values can be %
;
1import { Plugins } from 'rc-tween-one'; 2import SvgMorphPlugin from 'rc-tween-one/es/plugin/SvgMorphPlugin'; 3Plugins.push(SvgMorphPlugin); 4 5<TweenOne animation={{ SVGMorph: { path: '300,10 500,200 120,230 450,220 0,20' }}} />
name | type | default | description |
---|---|---|---|
path | string | null | svg path, ref: M0,0L100,0 ; |
attr | string | null | Svg tag attributes, example: polygon is points , path is d . |
maxSegmentLength | number | 0.5 | The lower the value, the smoother the generated animation will be, but at the expense of performance; |
1import { Plugins } from 'rc-tween-one'; 2import PathMotionPlugin from 'rc-tween-one/es/plugin/PathMotionPlugin'; 3Plugins.push(PathMotionPlugin); 4 5<TweenOne animation={{ PathMotion: { path: '300,10 500,200 120,230 450,220 0,20' }}} />
name | type | default | description |
---|---|---|---|
path | string / {x,y}[] | null | svg path, ref: M0,0L100,0 ; |
pathVars | IPathVars | null | Only valid if path is array [{x, y}, {x, y}] |
center | number \ string[] | ['50%','50%'] | center point, ref: [50px, 50px] ; |
x | boolean | true | x follow the path. |
y | boolean | true | y follow the path. |
rotate | boolean | true | rotate follow the path. |
name | type | default | description |
---|---|---|---|
type | thru \ soft \ cubic | thru | path type. thru same as the path; soft with the curve of attraction facing them, but not through the point; cubic allows you to define standard Cubic Bezier, example: [start, control, control, end] . |
curviness | 0-2 | 1 | This determines how "curvy" the resulting path is. 0 is lines, 1 is curved path, 2 would make it much more curvy. It can be 1.5 . |
relative | boolean | false | Increase relative to current value. example: if the target's x starts at 100 and the path is [{x:5}, {x:10}, {x:-2}] , it would first move to 105 , then 115 , and finally end at 113 . |
name | type | default | description |
---|---|---|---|
value | number | null | children number to value. |
floatLength | number | null | float precision length |
formatMoney | true \ { thousand, decimal } | null | format number to money. |
name | type | default | description |
---|---|---|---|
thousand | string | , | no explanation. |
decimal | string | . | no explanation. |
name | type | default | description |
---|---|---|---|
appear | boolean | true | whether support appear anim |
enter | object / array / func | { x: 30, opacity: 0, type: 'from' } | enter anim twee-one data. when array is tween-one timeline, func refer to queue-anim |
leave | object / array / func | { x: 30, opacity: 0 } | leave anim twee-one data. when array is tween-one timeline, func refer to queue-anim |
onEnd | func | - | one animation end callback |
animatingClassName | array | ['tween-one-entering', 'tween-one-leaving'] | className to every element of animating |
resetStyle | boolean | true | TweenOne resetStyle, reset the initial style when changing animation. |
exclusive | boolean | false | Whether to allow a new animate to execute immediately when switching. enter => leave : execute immediately leave |
component | React.Element/String | div | component tag |
componentProps | object | - | component tag props |
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/19 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More