Skip to content
NewYour data: charts, lists and meters that take your records
<px-flame>Custom elementControls you can feel

Temperature fire

Temperature slider drawn as a pixel fire simulation: low values leave embers, high values burn tall and Wild throws sparks.

View as Markdown
<px-flame>

Trydrag across it, from 0.0 to 2.0.

Playground

Change a prop and the component updates. Props marked live animate to the new value; the others rebuild the element.

Loading <px-flame>
Props
valuelive
<PxFlame value={0.9} />

Installation

pnpm dlx shadcn@latest add @lumesec/px-flame
First timeRegister the @lumesec registry once, or install by URL

Adds @lumesec to your components.json:

pnpm dlx shadcn@latest registry add @lumesec=https://elements.lumesec.ai/r/{name}.json

Or skip the setup and install by URL:

npx shadcn@latest add https://elements.lumesec.ai/r/px-flame.json

Usage

import { PxFlame } from "@/components/lumesec/px-flame";

export function Example() {
  return (
    <PxFlame value={0.9} />
  );
}

Behaviour

Model temperature as a real fire simulation. Low values leave embers, “Creative” burns tall, and “Wild” starts throwing sparks.

API reference

Attributes

valueReact propvalueTypenumberDefault0.9

Temperature from 0 to 2; values outside are limited to that range. Changing it moves the slider without firing change.

Events

Events bubble and cross the shadow boundary unless the description says otherwise.

changeReact proponChangeDetail{ value: number }

Fires when a drag ends and on each handled key press, with the temperature in steps of 0.1.

Methods

Call them on the element, for example through a React ref.

set(value: number)

Sets the temperature, limited to 0 to 2, and updates the readout and ARIA values without firing change. A value that is not a finite number is ignored.

Properties

valueTypenumber

Current temperature from 0 to 2. Setting it works like set().

Keyboard

KeysAction
ArrowRight / ArrowUpRaise the temperature by 0.1.
ArrowLeft / ArrowDownLower the temperature by 0.1.
Home / EndSet the temperature to 0 or 2.

Accessibility

  • The canvas is focusable with role="slider", aria-label="Temperature", aria-valuemin="0" and aria-valuemax="2".
  • aria-valuenow and aria-valuetext (for example "0.9, Balanced") follow the value.
  • The readout above the fire is plain text; assistive technology hears the value through the slider's aria-valuetext, so it is not announced twice.
  • Reduced motion: the fire is a still picture that is redrawn when the value changes, the flying embers at high values are skipped and the readout changes without the roll.

Theming

The element reads your shadcn theme tokens through its shadow root, so light and dark follow your theme. The accent comes from --lumesec. See Theming.

This component reads --foreground, --lumesec and --muted-foreground.

To restyle only LumeSec elements, set the matching --ui-* overrides: --ui-accent, --ui-fg and --ui-muted.

Notes

  • Labels: up to 0.35 Precise, up to 0.85 Balanced, up to 1.35 Creative, above that Wild. Embers start at 1.4.
  • Pointer input snaps to 0.1. The canvas is 190px tall and animates continuously while on screen, except under reduced motion.

Was this page helpful?