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
v-modelis the target temperature.currentis the temperature in the room now.min,max, andsteplimit the target (default 16 to 30, in steps of 0.5). The − and + buttons move it one step.v-model:modeisheat,cool,auto(default), oroff. 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.
unitis°C(default) or°F, andlocalesets the format.- Change the words with
labelsor a label pack:title,target,lower,higher,stopped, the four modes, and the functionsnow,heating,cooling, andholding.
Usage
ts
import { BlessThermostat } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
current* | number | — | the temperature in the room now |
min | number | 16 | |
max | number | 30 | |
step | number | 0.5 | |
unit | "°C" | "°F" | "°C" | |
locale | string | "en" | |
labels | Partial<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; }> | — | |
modelValue | number | 22 | |
mode | BlessThermostatMode | "auto" |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: number] | |
update:mode | [value: BlessThermostatMode] |