
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-transitioning
Advanced tools
React components for easily implementing basic CSS animations and transitions
A simple React library that provides components for managing animations and transitions with ease. It allows seamless transitions for both individual components and groups of elements. The library is inspired by react-transition-group and shares a similar API with a few notable differences.
findDOMNode.nodeRef Required: Unlike react-transition-group, there's no need to pass a nodeRef prop.The library provides components that allow you to easily create custom components with animations and transitions tailored to your needs. You can integrate them into your own React components to add smooth animations and transitions with minimal effort.
<FadeTransition in={visible}>
<div>Fading element</div>
</FadeTransition>
To install the library, run:
npm install react-transitioning
# or
yarn add react-transitioning
For more detailed information and usage examples, check out the Docs.
The Transition component allows you to control the mounting and unmounting of an element with transitions.
import { Transition } from 'react-transitioning'
...
<Transition in={!hidden} appear exit={false}>
{(transitionState) => (
<pre>{JSON.stringify(transitionState)}</pre>
)}
</Transition>
The CSSTransition component applies CSS classes based on the current transition state.
import { CSSTransition } from 'react-transitioning'
...
<CSSTransition in={!hidden} classNames="fade">
<div>Animated element</div>
</CSSTransition>
The StyleTransition component applies inline styles based on the current transition state. This is useful for customizing transitions without needing to rely on external CSS.
import { StyleTransition } from 'react-transitioning'
...
<StyleTransition
in={!hidden}
duration={300}
styles={{
enter: { opacity: 0 },
enterActive: { opacity: 1 },
}}
>
<div style={{ transition: 'opacity 300ms' }}>Animated element</div>
</StyleTransition>
The TransitionGroup component handles a set of elements, animating them as they are added or removed from the DOM.
import { TransitionGroup } from 'react-transitioning'
...
<TransitionGroup duration={300}>
{items.map((item) => (
<CSSTransition key={item.key} classNames="fade">
<div>{item.label}</div>
</CSSTransition>
))}
</TransitionGroup>
<CSSTransition
in={!hidden}
classNames="fade"
addEndListener={(phase, done) => {
nodeRef.current.addEventListener('transitionend', done, { once: true, capture: false })
}}
>
<div ref={nodeRef}>Animated element</div>
</CSSTransition>
type TransitionProps = {
children: React.ReactNode | ((transitionState: TransitionState, activePhase: TransitionPhase) => React.ReactNode);
in?: boolean;
appear?: boolean;
enter?: boolean;
exit?: boolean;
duration?: number;
alwaysMounted?: boolean;
addEndListener?: (phase: TransitionPhase, done: () => void) => void;
onEnter: () => void;
onEntering: () => void;
onEntered: () => void;
onExit: () => void;
onExiting: () => void;
onExited: () => void;
}
The TransitionState passed to the children function has the following structure:
type TransitionState = {
appear: boolean;
appearActive: boolean;
appearDone: boolean;
enter: boolean;
enterActive: boolean;
enterDone: boolean;
exit: boolean;
exitActive: boolean;
exitDone: boolean;
}
type CSSTransitionProps = Omit<TransitionProps, 'children'> & {
children: React.ReactElement<{ className?: string }>
classNames: string | {
appear?: string;
appearActive?: string;
appearDone?: string;
enter?: string;
enterActive?: string;
enterDone?: string;
exit?: string;
exitActive?: string;
exitDone?: string;
}
}
if classNames is a string, then the computed className will be suffixed based on the current transition state.
For example, when classNames is "fade", the fade-appear-active class will be applied during the appearActive phase.
If classNames is an object, the final className will be taken from that object based on the current transition state.
type StyleTransitionProps = Omit<TransitionProps, 'children'> & {
children: React.ReactElement<{ style?: React.CSSProperties };
styles: {
appear?: object;
appearActive?: object;
appearDone?: object;
enter?: object;
enterActive?: object;
enterDone?: object;
exit?: object;
exitActive?: object;
exitDone?: object;
}
}
The styles prop allows you to define inline styles based on the current transition state. For example, when the element enters, the enterActive styles will be applied.
type TransitionGroupProps = {
children: React.ReactNode;
appear?: boolean;
enter?: boolean;
exit?: boolean;
duration?: number;
}
MIT
FAQs
React components for easily implementing basic CSS animations and transitions
The npm package react-transitioning receives a total of 2,142 weekly downloads. As such, react-transitioning popularity was classified as popular.
We found that react-transitioning demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.