
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
rns-statusbar
Advanced tools
RNS statusbar component with SafeArea view comp, that uses native Android and iOS enhancements allowing you to set/get statusbar color and height.
A modern, lightweight, and high-performance React Native + Expo native module for managing the status bar height and background color across both Android and iOS.
Includes an optional SafeArea wrapper component for simplified layout handling and improved visual consistency.
Built natively using Kotlin (Android) and Swift (iOS) for maximum performance and reliability.
SafeArea wrapper componentnpm install rns-statusbar
yarn add rns-statusbar
If you use Expo Prebuild / EAS Build, the plugin is automatically registered in your configuration.
You can confirm that your app.json or app.config.js includes:
{
"expo": {
"plugins": ["rns-statusbar"]
}
}
Then rebuild your native project:
npx expo prebuild
For local production builds:
eas build --platform android --local
If using plain React Native (without Expo):
cd ios && pod install
import React, { useEffect } from 'react';
import {
SafeArea,
getStatusBarHeight,
getStatusBarColor,
setStatusBarColor,
useTopPadding,
} from 'rns-statusbar';
export default function App() {
const topPadding = useTopPadding();
useEffect(() => {
setStatusBarColor('#20232a'); // Set background color
getStatusBarHeight().then(console.log); // Log status bar height
getStatusBarColor().then(console.log); // Log current color
}, []);
return (
<SafeArea style={{ backgroundColor: '#fff' }}>
<Text style={{ marginTop: topPadding }}>Hello Status Bar!</Text>
</SafeArea>
);
}
| Function | Type | Description |
|---|---|---|
getStatusBarHeight() | Promise<number> | Returns status bar height in dp (defaults to 24). |
getStatusBarColor() | Promise<string> | Returns current status bar color (hex string). |
setStatusBarColor(color: string) | Promise<void> | Updates status bar background color. |
getTopPadding() | Promise<number> | Cached getter for status bar height. |
useTopPadding() | () => number | React hook returning the top padding. |
SafeAreaCross-platform container ensuring UI content is rendered safely beneath the status bar.
When used, it automatically handles keyboard visibility and eliminates the need for KeyboardAvoidingView.
<SafeArea style={{ backgroundColor: '#fff' }}>
{children}
</SafeArea>
| Prop | Type | Description |
|---|---|---|
style | `ViewStyle | StyleProp` |
children | React.ReactNode | Nested content. |
Type definitions (index.d.ts) are included by default, ensuring full IDE support:
import { getStatusBarHeight, SafeArea, getStatusBarHeight, getStatusBarColor, setStatusBarColor, useTopPadding } from 'rns-statusbar';
To test your local changes in another app:
# from your test app folder
yarn add file:../rns-statusbar
npx pod-install ios
MIT License © 2025 — Raiidr
Contributions are welcome!
If you encounter a bug or want to suggest a feature, open an issue or submit a pull request on GitHub.
FAQs
RNS statusbar component with SafeArea view comp, that uses native Android and iOS enhancements allowing you to set/get statusbar color and height.
We found that rns-statusbar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.