react-native-device-geometry
v0.4.3
Published
Device grometry for react native appliations
Readme
Introduction
React Native Device Geometry bridges the gap between physical device characteristics and your React Native UI. Unlike standard dimensions, this library provides precise data about corner radii, cutouts (notches, dynamic islands), foldable hinge states, and waterfall edge curves directly from native APIs.
It is designed for developers building premium, hardware-aware interfaces that need to adapt perfectly to the physical device.
Table of contents
📚 Documentation
🌟 Features
- Corner Geometry - Exact corner radii with curve type detection (circular vs continuous)
- Cutout Detection - Notch, hole-punch, and Dynamic Island geometry with SVG paths
- Foldable Support - Hinge physics (state, angle, bounds, orientation)
- Edge Curves - Waterfall display curve intensity
- Type-Safe - Comprehensive TypeScript definitions
- Zero Hardcoding - All data from native platform APIs
📱 Platform Support
| Feature | Android (API 28+) | iOS (11+) | | :--- | :---: | :---: | | Corner Radii | ✅ | ✅ | | Corner Curve Type | ❌ | ✅ | | Cutout Rects | ✅ | ✅ | | Cutout SVG Paths | ✅ | ❌ | | Dynamic Island | N/A | ✅ | | Foldable Physics | ✅ | N/A | | Hinge Angle | ✅ | N/A | | Waterfall Curves | ✅ | N/A |
📦 Installation
npm install react-native-device-geometry
# or
yarn add react-native-device-geometry🚀 Quick Start
import { DeviceGeometry } from 'react-native-device-geometry';
// Get complete device geometry
const geometry = await DeviceGeometry.getGeometry();
// Check for cutouts
const hasCutout = await DeviceGeometry.hasCutout();
// Check if device is foldable
const isFoldable = await DeviceGeometry.isFoldable();👏 Contributing
Contributions welcome! Please read our contributing guide.
📄 License
MIT © 2025
