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

Device tile ​

A device with its state, a switch, and the main reading

Shows one device in a smart home app. Put many tiles in a grid for a room. For a group of devices that change together, use the scene buttons.

Basic

Desk lamp

Studio

On · Brightness 80%

On air sign

Studio

Off

Air conditioner

Studio

On · 22 °C

Door

Hall

Closed

Dehumidifier

Storage

Offline

  • name is the name of the device. room, icon, and reading are optional. The reading is text, such as "22 °C" or "Closed".
  • If the device is on, v-model is true. The switch is named with the device, such as "Power, Desk lamp".
  • A device that is on has a thick top edge in the accent color and the word "On".
  • offline turns the switch off and shows "Offline" with a dashed edge.
  • sensor is for a device that only reads, such as a door sensor. It has no switch.
  • Change the words with labels or a label pack: on, off, offline, and power (a function).

Usage ​

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

API ​

Props

NameTypeDefaultDescription
name*string—
roomstring—the room, for example "Studio"
iconstring—an emoji or a short text for the device
readingstring—the main reading, as text, for example "21.5 °C" or "Door closed"
offlineboolean—the device does not answer: the switch is off and the tile says so
sensorboolean—a sensor has no switch
labelsPartial<{ on: string; off: string; offline: string; power: (name: string) => string; }>—
modelValuebooleanfalse

Events

NamePayloadDescription
update:modelValue[value: boolean]

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