React component for snow on your webpage ☃️
- Used on/extracted from Hack Club Secret Santa
- Code heavily inspired by
react-snow-effect
, but updated for React 16, supports server-rendering, & offers more options - Bootstrapped with
create-react-library
npm install --save resnow
yarn add resnow
Requires React 16.3 or later.
import React from 'react'
import Snow from 'resnow'
export default () => (
<div style={{ background: 'blue' }}>
<Snow />
</div>
)
Prop | Effect |
---|---|
max |
Number of particles. Default: 32 |
speed |
Speed of particles, in ms. Default: 32 |
color |
Color of particles. Default: rgba(255, 255, 255, 0.75) |
width /height |
Size of <canvas> . Default: 1024 x768 , but fills browser window |
MIT © @lachlanjc