Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Backgrounds

Pro

Fireplace Background for React

A fire burning along the whole bottom of a box: tongues of flame lick upward, embers drift up and the firelight flutters over everything. For React with Base UI, when a hero, a holiday page or a cosy card needs warmth and slow motion under its copy.

Framework

A fire burns along the whole bottom edge: tongues of flame lick upward and keep changing shape, a white-hot band glows at their base, embers drift up through the box, and the firelight flutters gently over everything, so the box is lit by the fire rather than filled with it. Each sheet of flame is a gradient of fire colours cut by two noise textures the browser draws once and CSS slides upward at different speeds, so the tongues reshape as they rise and nothing repaints. It follows your theme: glowing flames on a dark page, a warm amber blaze on a light one.

Use it for a seasonal hero, a "cosy" product page or a card that should feel warm. For grey plumes that rise over the whole box, use Smoke; for points of warm light with no flame, Fireflies; for sparks that burst in the sky, Fireworks. Keep your headline in the upper half, above the flames.

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 { Fireplace } from "@/components/ui/fireplace";

The fire burns behind whatever you put inside, along the container's bottom edge. Give the container a height; for the whole page, render it empty with className="fixed inset-0 -z-10".

<Fireplace className="flex min-h-[420px] flex-col items-center pt-16">
  <h1 className="text-4xl font-semibold">Pull up a chair</h1>
</Fireplace>

Demos

A low hearth

intensity="subtle" keeps the flames under a third of the height and embers={8} thins the sparks, for a small card. The tongues scale with the fire, so a low hearth still looks like a fire, not a cropped one.

Preview width

Witch-fire

colors takes four colours, from the fire's heart to the tips of the flames; here pale cyan to deep blue. flicker={false} stills the light's flutter and the flames' swell, for a steadier burn behind busier content. The card adds the dark class to its own container, so it glows on a light page too.

Preview width

Accessibility

The fire 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 flame and ember stops where it is, so a still, fully formed fire stays. Nothing flashes: the light flutters by less than a fifth of its strength, eased over half a second or more.

Put copy over it in your foreground colour (text-foreground) and keep it above the flames, in the upper half at the default intensity; there it stays well above 4.5:1 in both color schemes.

FAQ

Will it slow the page down?

No. The flames are two sheets, each a gradient under two sliding noise textures, and 22 embers rise with translate: all of it is composited without repainting, and no script runs per frame. The textures are drawn once, as images.

How do I change the flame colours?

Pass four colours to colors, from the white-hot heart to the tips; fewer are repeated. You can also set --fireplace-color-1 to --fireplace-color-4 in your CSS. Without them, each theme has its own palette: added light on a dark page, warm pigment on a light one.

How tall are the flames?

intensity sets it: subtle is a low hearth, under a third of the height; medium about two fifths; strong a blaze well over half. You can also set --fireplace-height to any length, such as 50cqh.

Can it burn steadily?

flicker={false} stills the light's flutter and the slow swell of the flames. The tongues still lick upward; with reduced motion everything stops.

Can the flames move faster or slower?

speed multiplies how fast they rise: 2 is twice as fast, 0.5 half as fast. The embers follow the same speed.

What does it look like in light mode?

A warm amber blaze on a cream page: on a light surface the flames are drawn as warm pigment multiplied into the page, rather than as light added to a dark scene. For the glowing hearth on a light page, add the dark class to the container, as the witch-fire demo does.

Does it respect reduced motion?

Yes. Every flame and ember freezes mid-burn, so the fire stays fully formed as a still picture.

API Reference

Fireplace

<div> data-slot="fireplace"

PropType
colors?string[]

Four CSS colours for the fire, from its white-hot heart to the tips of the flames, repeated when there are fewer. By default a palette per theme: warm white to deep red on a dark page, amber to brick on a light one.

embers?number

How many embers drift up through the box, from 0 to 32.

Default
22
flicker?boolean

The light's flutter and the flames' slow swell; false keeps a steady glow behind busy content (the flames still lick upward).

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

How tall the fire burns: subtle is a low hearth (under a third of the height), strong a blaze (well over half).

Type
"subtle" | "medium" | "strong"
Default
"medium"
speed?number

How fast the flames and embers rise: 2 is twice as fast, 0.5 half as fast.

Default
1
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
--fireplace-color-1string

The fire's heart (warm white; amber on a light page).

--fireplace-color-2string

The flames' body and the embers (amber).

--fireplace-color-3string

The flames' edges and the glow (orange).

--fireplace-color-4string

The tips (deep red; brick on a light page).

--fireplace-heightstring

How tall the flames burn (42cqh).

--fireplace-speedstring

How fast it rises, a multiplier (1).

All 100 backgrounds