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
- Host: GitHub
- URL: https://github.com/chilijung/react-native-device-size
- Owner: chilijung
- Created: 2017-08-07T08:54:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T14:48:30.000Z (over 8 years ago)
- Last Synced: 2025-02-28T15:18:11.228Z (over 1 year ago)
- Topics: devices, dimensions, react-native
- Language: JavaScript
- Size: 61.5 KB
- Stars: 5
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-device-size
[](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