Skip to content

NPM package for creating interactive particle effects from an image with React

Notifications You must be signed in to change notification settings

samzi123/react-image-particles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-image-particles

A React component that converts any image into interactive particles.

Example

Installation

Using npm: npm install react-image-particles

Using yarn: yarn add react-image-particles

Usage

import React from 'react';
import ImageToParticle from 'react-image-particles';

const App = () => {
  return (
    <ImageToParticle
      path="path/to/image"
      width={500}
      height={500}
      numParticles={1000}
    />
  );
};

export default App;

Props

The <ImageToParticle> component accepts the following props:

  • path (string) required: Image to apply the effect to.
  • width (number) optional: Width of the image canvas in pixels.
  • height (number) optional: Height of the image canvas in pixels.
  • particleSize (number) optional: Size of each particle in pixels.
  • numParticles (number) optional: Number of particles to use. Defaults to the number of pixels in the image.

Author

Samuel Henderson

Contributions are welcome! Repo: https://github.com/samzi123/react-image-particles

License

MIT

About

NPM package for creating interactive particle effects from an image with React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published