react-thunderboltbg
v1.0.4
Published
Reusable React thunderstorm background with animated lightning bolts.
Maintainers
Readme
React ThunderBolt Bg
A reusable React component that renders a thunderstorm background with animated lightning bolts.

Features
- Random lightning bolts starting from the top
- Adjustable lightning behavior
- Color-customizable bolts and flash
- Optional built-in control panel (hide/show support)
Component
LightningStorm is available at:
src/components/LightningStorm.tsx
Live Demo
- https://thunderboltbg.vercel.app/
Installation
Install from npm:
npm install react-thunderboltbgHow To Use
Import and render in your app:
import { LightningStorm } from 'react-thunderboltbg'
function App() {
return (
<LightningStorm
lightningFrequency={55}
boltLength={65}
boltWidth={55}
lightningColor="#DEEFFF"
showControls={true}
/>
)
}
export default AppProps
showControls prop is required in usage (pass true or false explicitly).
lightningFrequency?: numberboltLength?: numberboltWidth?: numberlightningColor?: stringshowControls?: boolean
Default Values
lightningFrequency = 55boltLength = 65boltWidth = 55lightningColor = "#DEEFFF"showControls = true
Number Rules (for frequency/length/width)
All number inputs are treated as percent values:
- Less than
0->0% - Greater than
100->100% - Between
0and100-> same value as percent (example:44->44%)
Controls (when showControls={true})
Lightning Frequency: controls how often strikes happenBolt Length: controls how long/deep bolts travelBolt Width: controls bolt thicknessLightning Color: changes bolt and flash tintHidebutton: hides control panelShow Controlsbutton (top-left): shows panel again
Example Without Controls
<LightningStorm
lightningFrequency={80}
boltLength={70}
boltWidth={60}
lightningColor="#C7E6FF"
showControls={false}
/>