normalize-size
v1.1.4
Published
A versatile utility package for React Native or React developers, designed to make styling elements responsive by dynamically adjusting properties such as font sizes, padding,margin and width based on the screen width and a reference size. This module ens
Downloads
13
Readme
normalize-size
A versatile utility package for React and React Native developers, designed to make styling elements responsive by dynamically adjusting properties such as font sizes, padding, margin, and width based on the screen width and a reference size. This module ensures a consistent and visually appealing layout across diverse devices and screen sizes.
Installation
Using npm:
npm install normalize-size
Using yarn:
yarn add normalize-size
Usage
import { sizeNormalize } from 'normalize-size';
// Example: Normalize a font size based on a reference size of 375 and the device's screen width.
// To make the width and fontSize responsive for all device screens using sizeNormalize
<Text style={[{ width: sizeNormalize(50), fontSize: sizeNormalize(18) }]}>
Normalize-size
</Text>
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.