Ember Glow

An animated fire-and-smoke glow that rises from the bottom of a footer or section.

Preview

Setup

Install with the shadcn CLI

$npx shadcn@latest add https://kinetikui.singhgourav.site/r/ember-glow.json

One command adds every file, the npm packages and any Kinetik components it builds on. Needs a components.json; the CLI offers to create one if your project has none.

Or install manually

  1. 1

    Run in your terminal:

    $npm install clsx tailwind-merge
  2. 2

    Copy lib/utils.ts from the Code tab. Skip if you already have cn().

  3. 3

    Create a components/ui/ember-glow/ folder and copy every file from the Code tab into it. Each file does one job, so you can read or change a piece without the rest.

  4. 4

    Import and render:

    Example
    import EmberGlow from "@/components/ui/ember-glow"
    
    <footer className="relative isolate h-screen">
      <EmberGlow className="absolute inset-0 -z-10" />
      {/* footer content */}
    </footer>

Usage

EmberGlow fills its parent. Put it behind your content in a positioned container.

Example
import EmberGlow from "@/components/ui/ember-glow"

export function Footer() {
  return (
    <footer className="relative isolate h-screen bg-[#0a0a0a] text-white">
      <EmberGlow className="absolute inset-0 -z-10" height={0.35} />
      <h2 className="absolute inset-x-0 bottom-8 text-center text-[12vw]">LET&apos;S CONNECT</h2>
    </footer>
  )
}

To make the fire taller on one side, set peak to where it should be tallest and raise focus. wind leans the flames and carries the smoke sideways.

Example
<EmberGlow peak={0.8} focus={0.7} wind={-0.4} />

It is a single WebGL fragment shader with no dependencies. Smoke is domain-warped noise scrolling upwards, and the noise height maps through four colour stops.

Props

PropTypeDefaultNotes
colors[string, string, string, string]fireFrom the smoke's dark edge to the hot core at the bottom.
backgroundstring"#0a0a0a"Colour above the fire.
heightnumber0.32How far up the fire reaches, as a fraction of the height.
speednumber1How fast the smoke rises. 0 freezes it.
intensitynumber1Brightness of the fire.
grainnumber0.05Film grain strength. 0 turns it off.
peaknumber0.5Where along the bottom the fire burns tallest: 0 left edge, 1 right edge.
focusnumber0How much the fire gathers at peak: 0 an even wall, 1 a single tall plume.
windnumber0Sideways wind from -1 (left) to 1 (right). The flames lean and drift with it.

Accessibility

  • The canvas is decorative: aria-hidden and pointer-events: none
  • With prefers-reduced-motion, the smoke stays still
  • It only animates while on screen and while the tab is visible