Calm motion: animations on this site only fade, with no movement
Scene buttons
Buttons that set many devices at once, such as Night or Away
A scene is a saved set of states for many devices. One tap starts it. For one device, use the device tile.
Basic
vue
<template>
<BlessSceneButtons v-model="active" :scenes style="max-width: 560px" />
</template>
<script setup lang="ts">
import { ref } from "vue";
import { BlessSceneButtons, type BlessScene } from "blessing-ui";
const scenes: BlessScene[] = [
{ id: "rec", name: "Recording", icon: "🎙️", description: "On air sign on, AC off, phone silent" },
{ id: "edit", name: "Editing", icon: "🎧", description: "Desk lamp on, AC 23 °C" },
{ id: "away", name: "Away", icon: "🔒", description: "All lights off, door locked" },
{ id: "night", name: "Night", icon: "🌙", description: "Lights off, dehumidifier on" },
];
const active = ref("edit");
</script>scenesis a list of scenes. Each scene has anidand aname, and an optionaliconanddescription.- A click emits
runwith the id. Your app then sets the devices. v-modelis the id of the scene that runs now. Its button is pressed and filled with the text color.- After a click, a hidden status line says that the scene is on.
- Change the words with
labelsor a label pack:titleandstarted(a function).
Usage
ts
import { BlessSceneButtons } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
scenes* | BlessScene[] | — | |
labels | Partial<{ title: string; started: (name: string) => string; }> | — | |
modelValue | string | — | the id of the scene that runs now |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: string | undefined] | |
run | [id: string] |