# react-native-scaled

> React Native multi screen sizes support

Latest version **1.0.5** (published 2020-10-15) · ISC license · 0 weekly downloads

## Install

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

## 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.5 |
| Published | 2020-10-15 |
| First published | 2020-10-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | maphongba008 |
| Maintainers | aaron.ta |
| Keywords | scaled, react, react-native |

## Links

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

## 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.5 (latest) — 2020-10-15

## README

[![Version](https://img.shields.io/npm/v/rn-scaled-sheet.svg)](https://www.npmjs.com/package/rn-scaled-sheet)
[![NPM](https://img.shields.io/npm/dm/rn-scaled-sheet.svg)](https://www.npmjs.com/package/rn-scaled-sheet)

# rn-scaled-sheet

React Native multi screen size support. Scale your dimensions depends on screen size. Inspired by [react-native-size-matters](https://github.com/nirsky/react-native-size-matters)

### Installation

```bash
npm install --save rn-scaled-sheet
or
yarn add rn-scaled-sheet
```

### Usage

```javascript
import React from "react";
import { Dimensions } from "react-native";
import { ScaledSheet, original } from "rn-scaled-sheet";

ScaledSheet.initialize({
  deviceWidth: Dimensions.get("window").width,
  // baseWidth?: number; // width in design
  // maxScale?: number;
  // minScale?: number;
});

/**
 * Eg: base screen size is 375 x 667
   Assume app running on 411 x 896 phone,
   use original function if you don't want to scale
 */
const styles = ScaledSheet.create({
  container: {
    flex: 1, // still 1
  },
  button: {
    width: 50, // will become ~55
    height: original(50), // still 50
    opacity: 0.5, // still 0.5
  },
});
```

### Properties will be scaled

| Properties              |
| ----------------------- |
| width                   |
| height                  |
| fontSize                |
| letterSpacing           |
| lineHeight              |
| borderBottomLeftRadius  |
| borderBottomRightRadius |
| borderTopLeftRadius     |
| borderTopRightRadius    |
| borderRadius            |
| borderBottomWidth       |
| borderTopWidth          |
| borderRightWidth        |
| borderLeftWidth         |
| borderWidth             |
| shadowRadius            |
| borderWidth             |
| translateX              |
| translateY              |
| marginLeft              |
| marginRight             |
| marginHorizontal        |
| marginVertical          |
| margin                  |
| paddingLeft             |
| paddingRight            |
| paddingHorizontal       |
| paddingVertical         |
| padding                 |
| top                     |
| left                    |
| bottom                  |
| right                   |

## Copyright and License

MIT License

Copyright (c) 2018 maphongba008

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