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

Battery level ​

The charge of a battery, with charging and low states

Shows the battery of a device, a sensor, or a phone. Put it on a device tile or in a list of devices.

Basic
  • level is the charge from 0 to 100. The percent shows next to the battery shape.
  • charging adds the word "Charging".
  • At or below low (default 20), and not on charge, the battery is red and says "Low".
  • The battery is a meter. Screen readers hear its name, such as "Battery, Door sensor", and the value with the states, such as "14%, Low". label gives the device.
  • Change the words with labels or a label pack: battery, charging, and low.

Usage ​

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

API ​

Props

NameTypeDefaultDescription
level*number—the charge, 0 to 100
chargingboolean—
lownumber20at or below this level, the battery is low
labelstring—what the battery is in, for example "Door sensor"
labelsPartial<{ battery: string; charging: string; low: string; }>—

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