Skip to content
caliper ui docs

Pro

Thermostat

A round thermostat. Drag around the dial or use the arrow keys to set the target; the arc fills from cool blue to warm amber as it rises, and a small tick marks the temperature the room is at.

Pro
pnpm dlx shadcn@latest add @caliper/thermostat

Living room

Turn the dial, or use the arrow keys.

Installs components/ui/thermostat.tsxDepends on none beyond ReactMotion none in component source

When to use

Use it for

  • Smart-home, HVAC and appliance controls.
  • Any bounded value that is best set by turning.

Skip it when

  • Ranges that are not bounded.
  • Settings that need to be exact on touch; pair it with plus and minus buttons.

Decisions

Why it is built this way, so you know what to keep when you change your copy.

Behaviour

Snaps to a step while dragging
The value moves in steps of half a degree, so the number never shows more precision than the control has.

Styling

Colour by position
The arc blends from cool to warm by where it ends, so the colour agrees with the number.

Usage

A slider with the mode in its value
Arrows move by a step, Page Up and Down by a degree, and the value text says heating, cooling or holding.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/thermostat

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source. It is built from Thermostat, angleFor and modeFor.

example.tsx
import { Thermostat, angleFor, modeFor } from "@/components/ui/thermostat"

The worked example comes with Pro

The 35-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

Thermostat

component

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
valuenumber—The target temperature.
defaultValuenumber21
onValueChange((value: number) => void)—
currentnumber19The temperature the room is at now.
minnumber10
maxnumber30
stepnumber0.5
unitstring"°"
labelstring"Temperature"

angleFor

component

No props of its own; it accepts the native props of its root element.

modeFor

component

No props of its own; it accepts the native props of its root element.

Accessibility

It exposes slider semantics, with aria-label, aria-valuemin, aria-valuemax, aria-valuenow, aria-valuetext and aria-hidden kept in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Changing values examples