This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

Expo Battery iconExpo Battery

A library that provides battery information for the physical device, as well as corresponding event listeners.

Android
iOS (device only)
Web
Included in Expo Go
Recommended version:
~56.0.4

expo-battery provides battery information for the physical device (such as battery level, whether or not the device is charging, and more) as well as corresponding event listeners.

Installation

Terminal
- npx expo install expo-battery
- yarn expo install expo-battery
- pnpm expo install expo-battery
- bun expo install expo-battery

If you are installing this in an existing React Native app, make sure to install expo in your project.

Usage

Basic Battery Usage
import { useBatteryLevel } from 'expo-battery'; import { StyleSheet, Text, View } from 'react-native'; export default function App() { const batteryLevel = useBatteryLevel(); return ( <View style={styles.container}> <Text>Current Battery Level: {batteryLevel}</Text> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, marginTop: 15, alignItems: 'center', justifyContent: 'center', }, });

API

import * as Battery from 'expo-battery';

No API data file found, sorry!