Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sr-tamim/react-motion-particles

A React component library for creating interactive motion particles effects based on mouse movements or device movement.
https://github.com/sr-tamim/react-motion-particles

motion-particles mousemove particlesjs react react-motion react-motion-particles reactjs wensyve

Last synced: about 18 hours ago
JSON representation

A React component library for creating interactive motion particles effects based on mouse movements or device movement.

Awesome Lists containing this project

README

        

# @wensyve/react-motion-particles

A React component library for creating interactive motion particles effects based on mouse movements or device movement.

## Installation

You can install this package using npm or yarn:

```sh
npm install @wensyve/react-motion-particles
```

```sh
yarn add @wensyve/react-motion-particles
```

## Usage
First, import the `MotionParticlesContainer` and `MotionParticle` components:

```js
import { MotionParticlesContainer, MotionParticle } from '@wensyve/react-motion-particles';
```

Then, wrap the `MotionParticle` components with the `MotionParticlesContainer` component:

```js


{/* Your content */}



{/* Your content */}

```

Each `MotionParticle` child of `MotionParticlesContainer` will move based on mouse movements or device movement. The `motionSpeed` prop determines the speed of the movement. The higher the value, the faster the movement.

Negative `motionSpeed` values will move the MotionParticle in the opposite direction of the mouse movement or device movement.

You can also use the `MotionParticlesContainer` at the root of your react app and then you can use the `MotionParticle` component anywhere in your app.

```js
// App.js file
import React from 'react';
import MotionParticlesContainer from '@wensyve/react-motion-particles';

function App() {
return (


{/* Your content */}


);
}

export default App;
```

```js
// SomeOtherComponent.js file
import React from 'react';
import { MotionParticle } from '@wensyve/react-motion-particles';

function SomeOtherComponent() {
return (



{/* Your content */}



{/* Your content */}



);
}
```

## Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.

## License
[MIT](https://choosealicense.com/licenses/mit/)

## Author
[![sr-tamim's Profilator](https://profilator.deno.dev/sr-tamim?v=1.0.0.alpha.4)](https://github.com/sr-tamim)

## Contributors
![Contributors](https://contrib.rocks/image?repo=sr-tamim/react-motion-particles)

#### Powered by [WENSYVE](https://wensyve.com)