Thermo Dial, animated React component
A thermostat ring you drag round or step with the arrow keys. Ticks light up to the set point, the glow shifts from cool blue to warm orange, the number rolls and the label says whether it is heating or cooling toward the room temperature.
- Pro
- Inputs & Controls
- Spring
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Heating21.0°Room 19.5°
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| room | number | 19.5 | Current room temperature; marks a tick and decides Heating, Cooling or Holding. |
| defaultValue | number | 21 | Target temperature the dial starts at. |
| min | number | 10 | Lowest settable temperature (start of the arc). |
| max | number | 30 | Highest settable temperature (end of the arc). |
| step | number | 0.5 | Increment for dragging and the arrow keys. |
| onChange | (value: number) => void | — | Called with the new target when the user drags or uses the keyboard. |
| autoplay | boolean | false | Turns the dial to a few set points until someone touches it. |