React Smoke Background
Realistic 3D smoke effects with particle systems and physics. Built on React Three Fiber with high-quality smoke simulation for React with TypeScript and shadcn/ui.
Powered by
Building realistic smoke effects?
Join our Discord community for help from other developers working with 3D particle systems.
Creating realistic smoke effects is notoriously difficult. Most developers end up with flat CSS animations or overly complex 3D setups. This React component uses the powerful react-smoke
library built on React Three Fiber to create authentic 3D smoke with particle physics, wind simulation, and turbulence effects.
Realistic 3D smoke simulation
High-quality smoke with particle physics, wind effects, and turbulence:
Inspired by isoteriksoftware
Built for React applications with TypeScript and Next.js in mind. The smoke simulation uses 3D particles with realistic physics, wind simulation, and turbulence effects powered by React Three Fiber. Works seamlessly with shadcn/ui design systems.
Installation
npx shadcn@latest add https://www.shadcn.io/registry/smoke.json
npx shadcn@latest add https://www.shadcn.io/registry/smoke.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/smoke.json
bunx shadcn@latest add https://www.shadcn.io/registry/smoke.json
Usage
import { Smoke } from "@/components/ui/smoke";
export default function Hero() {
return (
<Smoke>
<div className="relative z-10">
<h1>Your content here</h1>
</div>
</Smoke>
);
}
Why most smoke implementations fail
Most developers try to fake smoke with CSS animations or basic particle systems. The result looks flat and unrealistic. Others dive into complex 3D engines without understanding the underlying physics of smoke movement.
This React component uses the proven react-smoke
library that implements proper particle physics with wind simulation, turbulence effects, and realistic movement patterns. The particles behave like real smoke with proper density, opacity, and fluid dynamics.
Features
- 3D particle simulation - Realistic smoke using proper particle physics
- Wind simulation with customizable direction and strength
- Turbulence effects for natural, chaotic smoke movement
- Rotation animation with configurable rotation values
- Density control to adjust particle count and thickness
- Color customization with full RGB support
- Opacity control for subtle or dramatic effects
- TypeScript definitions for complete IDE support in React projects
- Performance optimized with efficient particle rendering
- shadcn/ui compatible for consistent design systems
API Reference
Smoke
Main container component for the smoke effect.
Prop | Type | Default | Description |
---|---|---|---|
density | number | 50 | Number of smoke particles (10 to 200) |
color | string | "#ffffff" | Smoke color (hex format) |
opacity | number | 0.5 | Smoke opacity (0.1 to 1.0) |
enableRotation | boolean | true | Enable rotation animation |
rotation | [number, number, number] | [0, 0, 0.1] | Rotation values for X, Y, Z axes |
enableWind | boolean | false | Enable wind effect |
windStrength | [number, number, number] | [0.01, 0.01, 0.01] | Wind strength for X, Y, Z axes |
enableTurbulence | boolean | false | Enable turbulence effect |
turbulenceStrength | [number, number, number] | [0.01, 0.01, 0.01] | Turbulence strength for X, Y, Z axes |
useSimpleScene | boolean | true | Use simplified scene wrapper |
className | string | - | Additional Tailwind CSS classes |
...props | HTMLAttributes<HTMLDivElement> | - | All standard div props |
Common gotchas
Smoke appears too light: Increase the density
prop to add more particles, or reduce opacity
to make individual particles more visible.
No movement visible: Make sure enableRotation
, enableWind
, or enableTurbulence
are set to true
. Static smoke without these effects can appear motionless.
Performance issues on mobile: High density
values (100+) can impact performance. Try reducing density to 30-50 for mobile devices.
Smoke looks flat: Enable enableTurbulence
and enableWind
with appropriate strength values to create more natural, chaotic movement.
Colors don't appear: Very dark colors may be invisible against dark backgrounds. Try lighter colors like #cccccc
or #ffffff
for better visibility.
You might also like
Explore other advanced background components for React applications:
Psychedelic Spiral
Hypnotic spiral patterns with WebGL shaders
Aurora
Northern lights effects with smooth CSS animations
Vortex
Swirling particle effects that create mesmerizing depth
Meteors
Falling star animations perfect for space themes
Waves
Fluid wave animations for ocean and water themes
Particles
Dynamic particle systems with physics simulation
Questions developers actually ask
React Shooting Stars Background
React shooting stars background with cosmic meteor effects. SVG animations and realistic trajectories create stargazing experiences with TypeScript and shadcn/ui.
React Sparkles Background
React sparkles background with magical twinkling particles. tsParticles creates interactive click effects with customizable colors, TypeScript, and shadcn/ui.