1.1.6 • Published 5 years ago

battery-indicator-element v1.1.6

Weekly downloads
28
License
MIT
Repository
github
Last release
5 years ago

Battery Indicator Element

Battery status indicator custom element.

  • Uses LitElement, a lightweight class that extends HTMLElement.

Usage

<battery-indicator percentage="85"></<battery-indicator>

Theming

Example
battery-indicator {
  width: 48px;
  height: 48px;
  --charge-fill: #000;
  --charge-fill-opacity: 1.0;
  --background-fill: #000;
  --background-fill-opacity: 0.3;
  --status-fill: #fff;
  --status-fill-opacity: 1.0;
}
Available Variables
variable namedefaultdescription
--charge-fill#000Fill color of area that represents charge.
--charge-fill-opacity1.0Opacity of area that represents charge.
--background-fill#000Fill color of background.
--background-fill-opacity0.3Opacity of background.
--status-fill#fffFill color of status icon (unknown, alert, charging).
--status-fill-opacity1.0Opacity of status icon (unknown, alert, charging).
--percentage-font-size16pxFont size of the percentage.
--percentage-color#000Color of the percentage.

Browser Support

This element requires ES2015 language features and the following browser APIs:

Development

  1. npm ci
  2. npm start
  3. http://localhost:8080

To Do

  • Make status scale to fill container with percentage
  • Add test suite
1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago