Spark Home

An animated, composable illustration of a home that shows live power flows between solar, battery, grid, heat pump, EV and the house, with sky, weather and time of day.

1.2 kWHeat pump
6.4 kWSolar
900 WHome
3.1 kWEV
1.2 kWBattery78%
0 WGrid

Usage

import {
  SPARK_HOME_NODES,
  SparkHome,
  SparkHomeLabel,
  SparkHomeLabelFace,
} from '@epilot/spark-ui/spark-home'
<SparkHome state={state} devices={devices}>
  {SPARK_HOME_NODES.map((node) => (
    <SparkHomeLabel key={node} node={node} />
  ))}
</SparkHome>

SparkHome draws the scene: the house, the energy flows between nodes, the sky for the given hour and weather, and the leader lines to each label. Each SparkHomeLabel places one value chip next to its node; render only the labels you need. Labels for devices that devices marks as absent render nothing, and their flows are dropped from the scene.

The roof picks up the page accent (--spark-9) and the scene follows the page's light or dark color scheme. Animation pauses while the scene is off screen.

Examples

Fewer devices

Pass devices to hide the heat pump, EV or battery. The camera reframes when the EV is absent.

0 WSolar
400 WBattery41%
200 WGrid
600 WHome

Interactive labels

Children of SparkHomeLabel replace the default face. Wrap SparkHomeLabelFace in a button (for example a PopoverTrigger) to make a label interactive; clicking a node in the scene clicks that label's button too.

State

Power values are in kW. battery is positive while charging and negative while discharging; grid is positive while importing and negative while exporting.

interface SparkHomeState {
  t: number
  weather: 'sunny' | 'cloudy' | 'rainy' | 'snowy'
  gridDown: boolean
  solar: number
  home: number
  heatpump: number
  ev: number
  battery: number
  grid: number
  soc: number
}

Accessibility

  • The scene is a section landmark labelled by aria-label (default: "Live energy flow of your home"); pass a translated label.
  • The illustration itself is decorative; values are exposed as text in the labels.
  • Interactive labels should wrap SparkHomeLabelFace in a real button so they are reachable by keyboard.
  • Animation respects prefers-reduced-motion.

API Reference

SparkHome

PropTypeDefault
stateSparkHomeStaterequired
devicesSparkHomeDevicesall devices present
festivebooleanfalse (adds seasonal lights)
aria-labelstring'Live energy flow of your home'
classNamestring—

SparkHomeLabel

PropTypeDefault
nodeSparkHomeNodeIdrequired
childrenReactNode<SparkHomeLabelFace node={node} />

SparkHomeLabelFace

PropTypeDefault
nodeSparkHomeNodeIdrequired
nameReactNodeEnglish node name
valueReactNodeNode power from state, in W or kW

On this page