React Simple Animate

3.5.3 · active · verified Tue Apr 21

React Simple Animate is a lightweight library providing declarative animation capabilities for React applications. It enables developers to implement animations from style A to style B, CSS keyframes animations, and chain multiple animations into sequences. Currently stable at version 3.5.3, it maintains an active release cadence with frequent minor updates focusing on bug fixes, type improvements, and React version compatibility, including support for React 19. Key differentiators include its minimal footprint and lack of external dependencies beyond React itself, making it an efficient choice for adding performant UI animations without bloat. It provides both component-based (`Animate`, `AnimateKeyframes`, `AnimateGroup`) and hook-based (`useAnimate`, `useAnimateKeyframes`, `useAnimateGroup`) APIs to suit different development styles, offering flexibility for both simple transitions and complex choreographed sequences.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates the usage of `Animate`, `AnimateKeyframes`, and `AnimateGroup` components to create individual, keyframe, and sequenced UI animations in React.

import React from "react";
import { Animate, AnimateKeyframes, AnimateGroup } from "react-simple-animate";

export default () => (
  <>
    {/* animate individual element. */}
    <Animate play start={{ opacity: 0 }} end={{ opacity: 1 }}>
      <h1>React simple animate</h1>
    </Animate>
    
    {/* animate keyframes with individual element. */}
    <AnimateKeyframes
      play
      iterationCount="infinite"
      keyframes={["opacity: 0", "opacity: 1"]}
    >
      <h1>React simple animate with keyframes</h1>
    </AnimateKeyframes>
    
    {/* animate group of animation in sequences */}
    <AnimateGroup play>
      <Animate start={{ opacity: 0 }} end={{ opacity: 1 }} sequenceIndex={0}>
        first
      </Animate>
      <Animate start={{ opacity: 0 }} end={{ opacity: 1 }} sequenceIndex={1}>
        second
      </Animate>
      <Animate start={{ opacity: 0 }} end={{ opacity: 1 }} sequenceIndex={2}>
        third
      </Animate>
    </AnimateGroup>
  </>
);

view raw JSON →