@erikwatson/react-snowfall
v1.3.0
Published
A React wrapper for @erikwatson/snowfall
Maintainers
Readme
React Snowfall
A React wrapper for @erikwatson/snowfall
Consult the base project for more details on features and usage.
Installation
npm install @erikwatson/react-snowfall
Usage
Generate a config using the Visual Config Editor and pass it to Snowfall.
Optionally, you can also pass a schedule.
Snowfall will create and attach itself to an element with whatever name you pass as the "attachTo" property of the config. By default, it attaches to a div with an id of "snowfall". Apply your styling to this.
import { Snowfall, UserConfig, UserSchedule } from "@erikwatson/react-snowfall";
export default function App() {
const myConfig: UserConfig = {
layers: [{ colour: 'red' }]
}
const mySchedule: UserSchedule = {
from: { month: 12, day: 1 },
to: { month: 12, day: 31 }
}
return <Snowfall config={myConfig} schedule={mySchedule} />;
}