Join our Discord Community

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.

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:

Loading component...

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.

PropTypeDefaultDescription
densitynumber50Number of smoke particles (10 to 200)
colorstring"#ffffff"Smoke color (hex format)
opacitynumber0.5Smoke opacity (0.1 to 1.0)
enableRotationbooleantrueEnable rotation animation
rotation[number, number, number][0, 0, 0.1]Rotation values for X, Y, Z axes
enableWindbooleanfalseEnable wind effect
windStrength[number, number, number][0.01, 0.01, 0.01]Wind strength for X, Y, Z axes
enableTurbulencebooleanfalseEnable turbulence effect
turbulenceStrength[number, number, number][0.01, 0.01, 0.01]Turbulence strength for X, Y, Z axes
useSimpleScenebooleantrueUse simplified scene wrapper
classNamestring-Additional Tailwind CSS classes
...propsHTMLAttributes<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:

Questions developers actually ask