Black Friday: 30% off Pro

Get 30% off

Updated

Energy Flow

New

Preview

Customize

Color
Interval1600ms
Capacity13.5kWh
Battery power3.8kW
Now14.4h
Width420px

Installation

npx shadcn@latest add https://uibrik.com/r/energy-flow.json
Adds the files to components/uibrik/energy-flow and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/energy-flow.

Usage

import { EnergyFlow } from "@/components/uibrik/energy-flow/energy-flow";​<EnergyFlow  title="Energy"  color="#e8a317"  live  interval={1600}  capacity={13.5}  maxBatteryPower={3.8}  showCurve  now={14.4}  width={420}  defaultValue={{ solar: 4.6, home: 2.1, battery: 64 }}  defaultSelected={null}  // value={{ solar: 0, home: 0, battery: 0 }}  // history={{ solar: [0], home: [0] }}  // selected="solar"  // onSelectedChange="solar"/>

Where to use Energy Flow

  • Smart home and solar apps

    Flow speed shows how much power moves where, so the card reads before any number does.

    Pairs with Gauge

  • Energy provider dashboards

    Tapping a node answers the usual question, where is this power coming from, without a separate chart.

    Pairs with KPI Tile

  • Climate tech landing pages

    A live diagram explains a battery and solar setup in a few seconds.

Props

EnergyFlow
title
Type string
"Energy"
Heading above the diagram.
color
Type string
"#e8a317"
Colour of solar and battery flows. Grid flows stay neutral.
live
Type boolean
true
Run the built-in simulation when no value is passed.
interval
Type number
1600
Time between simulated readings.
capacity
Type number
13.5
Battery size.
maxBatteryPower
Type number
3.8
Fastest the battery charges or discharges.
showCurve
Type boolean
true
Show today's solar and home use under the diagram.
now
Type number
14.4
Hour of day the curve stops at.
width
Type number
420
Width of the card; never wider than its container.
value
Type { solar: number; home: number; battery: number }
–
Live readings: solar and home in kW, battery charge 0–100. Pass it to drive the card from your own data.
defaultValue
Type { solar: number; home: number; battery: number }
{ solar: 4.6, home: 2.1, battery: 64 }
Starting readings for the simulation.
history
Type { solar: number[]; home: number[] }
–
Today's kW by hour, 24 values each, for the curve. Generated when left out.
selected / onSelectedChange
Type "solar" | "battery" | "grid" | "home" | null
–
Picked node, controlled.
defaultSelected
Type EnergyNode | null
null
Picked node on mount when uncontrolled.
className
Type string
–
Classes for the wrapper.