An open API service indexing awesome lists of open source software.

https://github.com/chilijung/react-native-device-size

classify mobile device size in react-native
https://github.com/chilijung/react-native-device-size

devices dimensions react-native

Last synced: about 1 year ago
JSON representation

classify mobile device size in react-native

Awesome Lists containing this project

README

          

# react-native-device-size

[![Build Status](https://travis-ci.org/Canner/react-native-device-size.svg?branch=master)](https://travis-ci.org/Canner/react-native-device-size)

classify mobile device size in react-native.

## Usage

```js
import deviceSize from 'react-native-device-size';

console.log(deviceSize); // return one of xsmall, small, normal, large, xlarge
```

## Device size category

iOS and android use different standard to classify, iOS use iphone versions, and android use [official classification](https://developer.android.com/guide/practices/screens_support.html) .

According to the documents:

- xlarge screens are at least 960dp x 720dp
- large screens are at least 640dp x 480dp
- normal screens are at least 470dp x 320dp
- small screens are at least 426dp x 320dp

#### xsmall

- iOS: iphone 4
- android: less than 426dp x 320dp

#### small

- iOS: iphone 5
- android: less than 470dp x 320dp

#### normal

- iOS: iphone 6
- android: less than 640dp x 480dp

#### large

- iOS: iphone 6 plus
- android: less than 960dp x 720dp

#### xlarge

- iOS: larger than iphone 6 plus
- android: larger than 960dp x 720dp

## Device Metric

https://material.io/devices/

## License

MIT