battery-lib
v1.0.4
Published
React hook and component for monitoring the device's battery status using the Battery Status API.
Downloads
7
Readme
🔋 battery-lib
A lightweight React + TypeScript library that provides:
useBattery— a React hook to access battery status (charging, level)Battery— a simple UI component to display battery info
Built with the Battery Status API. Works in most modern browsers.
✨ Features
- 📦 Easily consumable as a standalone hook or UI component
- 🔌 Detects charging state and battery level in real-time
- 🦺 Fully typed with TypeScript
- 🔧 Includes ESLint, Prettier, CI/CD for automated publishing to npm
🚀 Install
npm install battery-lib