# react-native-normalize

> simple function to make React Native app responsive easily

Latest version **1.0.1** (published 2019-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-normalize
pnpm add react-native-normalize
yarn add react-native-normalize
bun add react-native-normalize
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-07-30 |
| First published | 2019-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 486.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hung Dao Nguyen |
| Maintainers | newbiebr |
| Keywords | React Native, Typescript, Responsive, Normalize, react-native, react |

## Links

- npm: https://www.npmjs.com/package/react-native-normalize
- Repository: https://github.com/NewBieBR/react-native-normalize
- Homepage: https://github.com/NewBieBR/react-native-normalize#readme
- Issues: https://github.com/NewBieBR/react-native-normalize/issues
- npm.io page: https://npm.io/package/react-native-normalize

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-07-30
- 1.0.0 — 2019-07-30

## README

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)

### Without `normalize`
![](https://i.imgur.com/bLbnjsC.jpg)
### With `normalize`
![](https://i.imgur.com/4IqqAR2.jpg)

# React Native Normalize

**react-native-normalize** is a small and simple package that helps make your React Native app responsive easily.

It comes with a function `normalize` that will adapt a value depending on the screen's width or height so you can use it for `width, height, top, bottom, fontSize, borderRadius,...`


```javascript
// on iPhone 8
normalize(100)          // = 100
normalize(50, 'height') // = 50

// on iPhone 5s
normalize(100)          // = 86
normalize(50, 'height') // = 43

// on iPhoneXs Max
normalize(100)          // = 110
normalize(50, 'height') // = 67
```

## Quick example

```JSX
import React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import normalize from 'react-native-normalize';

export default class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <View style={styles.box}>
          <Text style={styles.text}>React Native Normalize</Text>
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  box: {
    alignItems: 'center',
    justifyContent: 'center',
    top: normalize(180, 'height'),
    left: normalize(40),
    width: normalize(300),
    height: normalize(300),
    borderRadius: normalize(150),
    backgroundColor: '#009fcd',
  },
  text: {
    fontSize: normalize(60),
    color: 'white',
  },
});
```

---
_Source: https://npm.io/package/react-native-normalize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
