A simple utility to simulate CSS viewport units (vw, vh, vmin, vmax) in React Native styles.
react-native-viewport-units is a JavaScript utility library that simulates CSS viewport units (vw, vh, vmin, vmax) in React Native. It solves the problem of creating responsive layouts in React Native by allowing developers to size elements relative to the device's screen dimensions, which isn't natively supported.
React Native developers building mobile applications that require responsive design across various screen sizes and orientations.
Developers choose this library for its simplicity and direct approach to a common React Native pain point, offering a lightweight, no-fuss solution until official viewport unit support is added.
Incredibly simple utility for (sort of) using viewport units with React Native.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works directly with React Native's StyleSheet and inline styles, as shown in the README with examples like '50*vw', making it easy to adopt without configuration.
Has no complex dependencies, focusing on a single purpose to keep the bundle minimal, which is emphasized in the project's philosophy.
Enables developers to create screen-adaptive designs without manual calculations, addressing React Native's lack of native viewport unit support.
The README provides concise usage examples for both inline styles and StyleSheet, reducing the learning curve for implementation.
Requires multiplication operators (e.g., 50*vw), which deviates from CSS conventions and can lead to errors or confusion for developers used to native CSS.
As per the roadmap, it doesn't handle orientation changes automatically, meaning layouts won't update on rotation without additional code.
Calculates sizes based on initial screen dimensions, so it may not account for dynamic changes like keyboard appearance or split-screen modes.