A simple React library to add A Fog / Smoke effect
npm install --save react-smoke-effect
OR
yarn add react-smoke-effect
import React from 'react'
import SmokeScene from "react-smoke-effect"
import SmokeImage from "./assets/smoke.png"
const App = () => {
return (
<div>
<SmokeScene
backgroundColor="#D3A863"
particleImage={SmokeImage} // particleImage="/path/to/image.png"
particleCount={20}
baseOpacity={0.4}
/>
// or for default settings
<SmokeScene
particleImage={SmokeImage} />
</div>
)
}
export default App
Prop | Type | Default | Description |
---|---|---|---|
backgroundColor | string / hex | 'transparent' | Background color. |
particleCount | number | 10 | Number of particles to use. |
baseOpacity | number | 0.45 | Opacity of particles. |
particleImage | string | (default smoke) | Image of particles |
MIT © YidirK Powered by Hergol
This module was bootstrapped with create-react-library.