Get the precise, native corner radius (in pixels/points) of the device screen, especially on iOS and Android devices with rounded displays.
npm install expo-screen-corner-radiusGet the precise, native corner radius of the device screen on iOS and Android devices with rounded displays.
``bash`Install the library
npm install expo-screen-corner-radius
`jsx
import { getCornerRadiusSync } from "expo-screen-corner-radius";
export default function App() {
const radius = getCornerRadiusSync(); // Get corner radius in dp
return
}
// or using the async function
import { getCornerRadius } from "expo-screen-corner-radius";
export default function App() {
const [radius, setRadius] = useState(0);
useEffect(() => {
getCornerRadius().then(setRadius);
}, []);
return
}
`
Note: Not available in Expo Go. Use a custom development client or build a standalone app to test.
This library does not use any private APIs and is compliant with App Store guidelines for both iOS and Android platforms.
A synchronous function that returns the device's screen corner radius.
| Platform | Return Value | Notes |
| :--------------------- | :----------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| iOS (iPhone, iPad) | Points (dp/pt) | The value is determined natively in Swift using the hardware model identifier (uname()) and a lookup table. Returns 0 if the device has no rounded corners (e.g., iPhone SE). Returns null if the model is unknown. |null
| Android | Points (dp/pt) | Returns the device's corner radius in dp/pt, if available. Only available in Android 12 and later. Returns otherwise. |null
| Web / Other | 0 | Always returns . |
An asynchronous function that returns a promise resolving to the device's screen corner radius. Same behavior as getCornerRadiusSync()`
Contributions are welcome! If you find any inaccuracies in the corner radius values, or anything else, please open a pull request.
The corner radius values for iOS are sourced from the community-maintained data in the open-source BezelKit repository.