Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Backgrounds

Pro

Smoke Background for React

Soft plumes of smoke that rise from below a box, swell, turn and thin out. For React with Base UI, when a hero, an event page or a moody section needs slow, textured motion behind its copy.

Framework

Soft plumes rise from below the bottom edge, swell, turn and thin out, like smoke from a fire or haze on a stage. Each puff is a gradient circle textured by one fixed noise image, and CSS keyframes move, grow and turn it; as it turns, its texture turns with it, which reads as the smoke curling. The puffs are placed from a seeded hash, so no script runs while it drifts. It follows your theme: pale smoke over a dark page, charcoal over a light one.

Use it for a dramatic hero, an event or music page, or a section that should feel atmospheric. For flat horizontal mist, use Fog; for the fire under the smoke, Fireplace; for coloured clouds with stars, Nebula; for soft colour washes that stay put on paper, Watercolor.

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Usage

import { Smoke } from "@/components/ui/smoke";

The smoke rises behind whatever you put inside, over the whole box. Give the container a height; for the whole page, render it empty with className="fixed inset-0 -z-10".

<Smoke className="flex min-h-[420px] items-center justify-center">
  <h1 className="text-4xl font-semibold">Into thin air</h1>
</Smoke>

Demos

In a breeze

wind={0.6} leans every plume to the right and speed={1.4} makes it rise faster, here in a small card. wind goes from -1 (left) to 1 (right).

Preview width

Stage smoke

smokeColor takes any CSS colour; here violet, with intensity="strong" for thick smoke. The container has the dark class, so the smoke glows on a dark stage in either theme.

Preview width

Accessibility

The smoke is decorative: it's hidden from assistive tech and never takes the pointer, and your content stays on top in normal flow. With reduced motion every puff stops where it is, so the stage stays smoky as a still picture. Nothing flashes.

Put copy over it in your foreground colour (text-foreground). At the default intensity a headline stays readable in both themes; behind body text, use intensity="subtle". wind is a physical direction, so it isn't mirrored on right-to-left pages.

FAQ

How dense is it?

count sets how many puffs rise at once (14 by default, up to 24) and intensity how opaque they get: subtle, medium or strong.

Can it blow sideways?

Yes. wind from -1 to 1 leans every plume left or right, and speed sets how fast they rise: 2 is twice as fast, 0.5 half as fast.

How do I colour it?

Pass any CSS colour to smokeColor, or set --smoke-color in your CSS. By default it's your foreground colour mixed 70% toward the background, so it fits light and dark themes.

Is it heavy?

No script runs per frame: the puffs move with transform and opacity, which the browser composites without repainting, and each rises three times per animation cycle, so the page is barely woken. Each puff is a large texture on the GPU (about 4 MB on a 2× screen), so on a phone keep count under 10.

Why doesn't it use a blur filter?

A full-screen blur redrawn every frame is what makes smoke effects slow. Here the softness comes from the gradient and the noise texture, which the browser draws once.

Does it respect reduced motion?

Yes. The puffs stop where they are, so the stage stays smoky but nothing moves.

API Reference

Smoke

<div> data-slot="smoke"

PropType
count?number

How many puffs rise at once, from 0 to 24. Each is a large texture on the GPU: keep it under 10 on a phone.

Default
14
intensity?"subtle" | "medium" | "strong"

How thick the smoke gets: subtle behind body text, strong for a stage.

Type
"subtle" | "medium" | "strong"
Default
"medium"
smokeColor?string

The smoke's colour, any CSS colour.

Default
your foreground colour, 70% toward the background
speed?number

How fast the smoke rises: 2 is twice as fast, 0.5 half as fast.

Default
1
wind?number

Leans every plume sideways, from -1 (left) to 1 (right). It's a physical direction, the same on right-to-left pages.

Default
0
render?ReactElement | ((props: object, state: object) => ReactElement)

Replace the host element or compose it with another component.

Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string

Merged with the part's classes.

CSS variableType
--smoke-colorstring

The smoke's colour (the foreground, 70% toward the background).

--smoke-speedstring

How fast it rises, a multiplier (1).

--smoke-strengthstring

How opaque it gets, a multiplier (1).

--smoke-windstring

How far the plumes lean, from -1 to 1 (0).

All 100 backgrounds