Skip to main content

React Spring

Use "@pixi/react-animated" to import react-spring animated components.

Usage

import React from 'react';
import { Spring } from 'react-spring';
import { Texture } from 'pixi.js';
import { Stage, Sprite } from '@pixi/react-animated';

const App = () => (
<Stage>
<Spring native from={{ x: 0, y: 0 }} to={{ x: 200, y: 200 }}>
{(props) => <Sprite texture={Texture.WHITE} tint={0xff0000} {...props} />}
</Spring>
</Stage>
);

Example

Click anywhere to animate

Result
Loading...
Live Editor

Animating tint values

Result
Loading...
Live Editor