
Product
Introducing Custom Pull Request Alert Comment Headers
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
react-spriter
Advanced tools
ReactSpriter is a React component that allows you to create animated sprites by providing a convenient interface
ReactSpriter is a React component that allows you to create animated sprites using styled-components. It simplifies the process of animating sprites by providing a convenient interface to define sprite properties and animations.
DEMOS: https://react-spriter.callumeddisford.co.uk/
To use ReactSpriter in your React project, you can install it via npm or yarn:
npm install react-spriter
or
yarn add react-spriter
import ReactSpriter from "react-spriter";
class MyComponent extends React.Component {
render() {
return (
<ReactSpriter
sprite={sprite}
frameWidth={frameWidth}
frameHeight={frameHeight}
spriteWidth={spriteWidth}
duration={animationDuration}
isInfinite={isInfinite}
shouldAnimate={shouldAnimate}
layer={layer}
/>
);
}
}
| Field | Type | Description |
|---|---|---|
| sprite | string | The URL of the sprite image. |
| frameWidth | number | The width of each frame in the sprite. |
| frameHeight | number | The height of each frame in the sprite. |
| spriteWidth | number | The total width of the sprite image. |
| animationDuration | number | The duration of the animation in milliseconds. |
| isInfinite | boolean | Whether the animation should loop infinitely. |
| shouldAnimate | boolean | (optional) Whether the animation should start automatically. Defaults to true. |
| layer | number | (optional) The layer of the sprite animation. If multiple sprites are layered on top of each other, this value determines the order of rendering. |
Here's an example of how you can use ReactSpriter to animate a sprite, in this example each frame width is 64 and the total sprite image width is 512 this indicates there are 8 frames to animate over:
import React from "react";
import ReactSpriter from "react-spriter";
import sprite from "path/to/sprite.png";
const MyComponent = () => {
const frameWidth = 64;
const frameHeight = 64;
const spriteWidth = 512;
const animationDuration = 1000;
const isInfinite = true;
const shouldAnimate = true;
const layer = 0;
return (
<ReactSpriter
sprite={sprite}
frameWidth={frameWidth}
frameHeight={frameHeight}
spriteWidth={spriteWidth}
duration={animationDuration}
isInfinite={isInfinite}
shouldAnimate={shouldAnimate}
layer={layer}
/>
);
};
export default MyComponent;
Please check out the src/examples directory for more
To start storybook locally:
npm install
npm run storybook
FAQs
ReactSpriter is a React component that allows you to create animated sprites by providing a convenient interface
The npm package react-spriter receives a total of 0 weekly downloads. As such, react-spriter popularity was classified as not popular.
We found that react-spriter demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.

Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.

Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.