Skip to content
Calm motion: animations on this site only fade, with no movement

Thermostat ​

A dial that sets the target temperature and shows the current one

Controls the heating or the air conditioning of a room in a smart home app. The dial is the knob, so the arrow keys move it too.

Basic

Now 25.5 °C

Cooling to 22.5 °C

Thermostat
  • v-model is the target temperature. current is the temperature in the room now.
  • min, max, and step limit the target (default 16 to 30, in steps of 0.5). The − and + buttons move it one step.
  • v-model:mode is heat, cool, auto (default), or off. The modes are a group of native radio buttons.
  • A status line says what the system does, such as "Cooling to 22.5 °C" or "Holding 22 °C". In heat mode, a room that is too warm only holds. In cool mode, a room that is too cold only holds. Off turns the dial and the buttons off.
  • unit is °C (default) or °F, and locale sets the format.
  • Change the words with labels or a label pack: title, target, lower, higher, stopped, the four modes, and the functions now, heating, cooling, and holding.

Usage ​

ts
import { BlessThermostat } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
current*number—the temperature in the room now
minnumber16
maxnumber30
stepnumber0.5
unit"°C" | "°F""°C"
localestring"en"
labelsPartial<Record<BlessThermostatMode, string> & { title: string; target: string; now: (t: string) => string; lower: string; higher: string; heating: (t: string) => string; cooling: (t: string) => string; holding: (t: string) => string; stopped: string; }>—
modelValuenumber22
modeBlessThermostatMode"auto"

Events

NamePayloadDescription
update:modelValue[value: number]
update:mode[value: BlessThermostatMode]

Released under the MIT License. Character names and artwork belong to their owners.