expo-constants
@amazon-devices/expo-constants
provides system information that remains constant throughout the lifetime of your app's install.
Installation
- Add the JavaScript library dependency in the
package.json
file.dependencies: { ... "@amazon-devices/expo-constants": "~2.0.0", "expo": "~50.0.0", ... }
- Reinstall dependencies using
npm install
command.
Examples
import React from 'react';
import Constants from '@amazon-devices/expo-constants';
import {StyleSheet, Text, View} from 'react-native';
export const App = () => {
return (
<View style={styles.container}>
<Text style={styles.text}>
isHeadless: {String(Constants.isHeadless)}
</Text>
<Text style={styles.text}>
statusBarHeight: {Constants.statusBarHeight}
</Text>
<Text style={styles.text}>
systemFonts: {Constants.systemFonts.join(', ')}
</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
justifyContent: 'center',
alignItems: 'center',
},
text: {
fontSize: 30,
color: 'black',
},
});
API reference
Check out the dedicated documentation page for info about this library, API reference and more: Official Expo documentation for expo-constants.
Implementation details
Currently, all values are mocks. Don't depend on any of the constants inside this package.
Supported versions
Package Version | Based On | @amazon-devices/react-native-kepler version |
---|---|---|
2.0.x | 15.2.0 | 2.0.x |
Additional resources
For information on additional libraries, see Supported Third-Party Libraries and Services.
Last updated: Sep 30, 2025