A web component that detects and displays the current battery status as an icon. It uses Polymer 1.x and HTML5 Navigator.getBattery() API.

[ This description is mirrored from README.md at github.com/Protoss78/battery-status-icon on 2019-05-22 ]

battery-status-icon

A web component that detects and displays the current battery status as an icon. It uses Polymer 1.x and can autodetect current battery status using the new HTML5 Navigator.getBattery() API. But the battery level and charging status can also be set from the outside (e.g. in combination with Cordova and the battery plugin).

Install:

bower i battery-status-icon -S

Example:

<paper-material>
    <h1>No Label</h1>
    <battery-status-icon></battery-status-icon>
    <battery-status-icon level="33" charging></battery-status-icon>
    <battery-status-icon level="15" show-label></battery-status-icon>
    <battery-status-icon level="66"></battery-status-icon>
    <battery-status-icon autodetect show-label></battery-status-icon>
</paper-material>

Preview

Install

Link to this version
ImportedReleased 28 May 2017MIT License
Framework Support
Polymer 2.0+
Also supported:
Polymer 1 (0.0.6)
Browser Compatibility
Install with
bower install --save Protoss78/battery-status-icon"#1.0.1"
Run the above Bower command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 1.0.1

Dependencies

  • polymer#Polymer/polymer#1.9 - 2
  • iron-icons#PolymerElements/iron-icons#1 - 2
  • paper-tooltip#PolymerElements/paper-tooltip#1 - 2