Gathering detailed insights and metrics for react-transition-components
Gathering detailed insights and metrics for react-transition-components
Gathering detailed insights and metrics for react-transition-components
Gathering detailed insights and metrics for react-transition-components
@chakra-ui/transition
Common transition components for Chakra UI
@smart-react-components/transition
SRC transition includes transition components.
@lidofinance/transition
React HOC based on [React Transition Group](https://reactcommunity.org/react-transition-group/) for Lido Finance projects. Part of [Lido UI Components](https://github.com/lidofinance/ui/#readme)
react-components-transition
A very small but useful React component, which allows to smart transition between components without adding unnecessary state's hooks to render conditionally
Easily configurable React components for animations / transitions 💃
npm install react-transition-components
Typescript
Module System
TypeScript (99.58%)
JavaScript (0.42%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
19 Stars
159 Commits
5 Forks
3 Watchers
4 Branches
3 Contributors
Updated on Nov 01, 2024
Latest Version
4.2.0
Package Id
react-transition-components@4.2.0
Unpacked Size
71.17 kB
Size
13.54 kB
File Count
46
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
25
An animation component library & higher-order component for generating easily configurable <Transition>
components from react-transition-group
.
react-transition-components
is 3 kB gzipped, has peer dependencies on react
and react-transition-group
, and supports webpack
tree-shaking by default: https://bundlephobia.com/result?p=react-transition-components
yarn install react-transition-components
react-transition-components
has 2 goals:
createTransition
higher-order component.The aforementioned createTransition
higher-order component wraps <Transition>
from react-transition-group
, maintains backwards compatibility with its props, and enhances it with configurable timings, delays, and easings. It provides a concise API, allowing you to express an enter/exit CSS transition in 6 lines of code in the simplest case:
1import { createTransition } from 'react-transition-components'; 2 3const CustomTransition = createTransition({ 4 from: { transform: 'scale(0) skew(45deg)', opacity: 0 }, 5 enter: { transform: 'scale(1) skew(0deg)', opacity: 1 } 6});
react-transition-components
comes with multiple components that work out of the box. A Storybook is live at: https://setsun.io/react-transition-components
The following components are included, and implement the most common CSS transitions:
opacity
animationsheight
animationstranslate3d
animationsscale3d
animationsrotate3d
animationsskew
animationsclip-path
animationscreateTransition(config: TransitionConfig)
The createTransition
higher-order component returns a pre-configured <Transition>
component that allows you to create transition components that can be used immediately, and can be configured via props
as your animation needs change.
All components created via createTransition
support all props from the <Transition>
component from react-transition-group
(https://reactcommunity.org/react-transition-group/transition).
These generated components also have extended functionality and have the following base props for customizing transition properties and timings:
1type Props = { 2 // a custom duration for your transition, with the ability 3 // to also have separate enter / exit durations 4 duration?: number | { 5 enter: number; 6 exit: number; 7 }; 8 9 // a custom delay for your transition, with the ability 10 // to also have separate enter / exit delays 11 delay?: number | { 12 enter: number; 13 exit: number; 14 }; 15 16 // a CSS transition easing curve 17 easing?: string; 18 19 // React children can either be a ReactNode, or a function that takes 20 // a style and status, and returns a ReactNode 21 children: React.ReactNode | ((style: React.CSSProperties, status: TransitionStatus) => React.ReactNode); 22}
createTransition
has the following type signature:
1type TransitionConfig = { 2 from: React.CSSProperties | LazyCSSProperties; 3 enter: React.CSSProperties | LazyCSSProperties; 4 exit?: React.CSSProperties | LazyCSSProperties; 5 transitionProperty?: string; 6} 7 8type createTransition = (config: TransitionConfig) => React.SFC<TransitionProps>
from: React.CSSProperties | LazyCSSProperties
The from
property is the starting style of your transition component. This is the first state that your component animation will animate from. If the exit
property is not specified, the from
property is also used for the exit animation.
enter: React.CSSProperties | LazyCSSProperties
The enter
property is the entering style of your transition component. This is the state where your component animation will animate to, and its final resting state.
exit?: React.CSSProperties | LazyCSSProperties
The exit
property is the exiting style of your transition component. This is an optional property for explicitly specifying a state to animate to when exiting, especially if you want an exit
animation that is asymmetric from your enter
animation.
1const FadeTransition = createTransition({ 2 from: { opacity: 0 }, 3 enter: { opacity: 1 } 4});
1const ScaleEnterClipExitTransition = createTransition({ 2 from: { 3 transform: 'scale(0.5)', 4 opacity: 0, 5 clipPath: 'circle(100% at 50% 50%)' 6 }, 7 enter: { 8 transform: 'scale(1)', 9 opacity: 1, 10 clipPath: 'circle(100% at 50% 50%)' 11 }, 12 exit: { 13 transform: 'scale(1)', 14 opacity: 0, 15 clipPath: 'circle(0% at 50% 50%)' 16 }, 17});
1const ClipScaleFadeTransition = createTransition({ 2 from: (props) => { 3 return { 4 opacity: props.fade ? 0 : 1, 5 transform: `scale(${props.scale.start})`, 6 clipPath: 'circle(100% at 50% 50%)' 7 } 8 }, 9 enter: (props) => { 10 return { 11 opacity: 1, 12 transform: `scale(${props.scale.end})` 13 clipPath: 'circle(100% at 50% 50%)' 14 } 15 }, 16 exit: (props) => { 17 return { 18 opacity: props.fade ? 0 : 1, 19 transform: `scale(${props.scale.start})`, 20 clipPath: 'circle(0% at 50% 50%)' 21 } 22 }, 23}); 24 25ClipScaleFadeTransition.defaultProps = { 26 fade: true, 27 scale: { 28 start: 0.5, 29 end: 1, 30 } 31} 32
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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