dimensiontabletmobile
v1.0.2
Published
react native dimension file
Downloads
8
Readme
📱 dimensiontabletmobile
Responsive dimension utility for React Native — scale sizes, fonts, and spacing dynamically across mobile and tablet devices.
🚀 Installation
npm install dimensiontabletmobile
yarn add dimensiontabletmobile
## 🚀 Installation
import {
normalize,
vh,
vw,
screenWidth,
screenHeight,
} from 'dimensiontabletmobile';
const styles = StyleSheet.create({
text: {
fontSize: normalize(16),
marginVertical: vh(20),
marginHorizontal: vw(10),
},
});
##🧠 Functions
normalize(size: number): number
Scales font size using PixelRatio for device-independent text sizing.
vh(value: number): number
Returns scaled height based on design reference.
For tablets → uses actual height proportion.
For phones → uses width-based scale to better match layout scaling.
vw(value: number): number
Returns scaled width based on design reference.
For phones → uses actual height proportion.
For tablets → uses width-based scale.
screenWidth: number
Longest side of the screen (useful for determining layout width)
screenHeight: number
Shortest side of the screen (for layout height reference)