WebberUI

Streak Flame Counter

A Duolingo-style streak flame — the flame flares when the number goes up and changes color at milestones

Layered SVG flames flicker continuously; when the day count goes +1 the flame flares up, sparks scatter upward, and the number flips up like a split-flap. On reaching a milestone (7 / 30 / 100 by default) the flame shifts to a new color ramp and a rotating halo appears — a good fit for check-in, learning, fitness, and other streak-tracking scenarios.

Loading preview…
npx shadcn@latest add https://webberui.com/r/streak-flame-counter.json

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

12
120
<StreakFlameCounter />

Installation

npx shadcn@latest add https://webberui.com/r/streak-flame-counter.json

Or, once registries are configured in components.json, install it as @webberui/streak-flame-counter.

Usage

import { StreakFlameCounter } from "@/components/ui/streak-flame-counter";

const [count, setCount] = useState(5);

<StreakFlameCounter count={count} milestones={[7, 30, 100]} />
<button onClick={() => setCount((c) => c + 1)}>+1 day</button>

Props

PropTypeDefaultDescription
countnumberThe current streak in days; increasing it triggers the flare and the flip
milestonesnumber[][7, 30, 100]Milestone thresholds; reaching one shifts the flame's color ramp and brings up the halo
unitstring"天"Unit text after the number (the built-in default is the Chinese word for days)
captionstring"連續紀錄"Caption text below the number (the built-in default is Chinese for "streak")
sizenumber120Flame width (px); the height is derived proportionally
showProgressbooleantrueWhether to show a progress bar toward the next milestone
classNamestringForwarded to the outer container

Accessibility

  • When the user has "reduce motion" enabled at the system level, the flame neither flickers nor flares and the number updates directly without flipping
  • The day count is read out in full through hidden text with role="status" and aria-live="polite", while the flipping number is hidden from assistive technology
  • Purely decorative layers such as the flame, the halo, and the sparks are all marked aria-hidden
  • Milestone progress is presented as text ("N days to go"), and the progress bar itself is decorative and aria-hidden

On this page