https://github.com/nicolasdelfino/react-native-devices
React Native helper for iOS devices.
https://github.com/nicolasdelfino/react-native-devices
device-detection ios react-native
Last synced: about 2 months ago
JSON representation
React Native helper for iOS devices.
- Host: GitHub
- URL: https://github.com/nicolasdelfino/react-native-devices
- Owner: nicolasdelfino
- License: mit
- Created: 2018-03-12T14:16:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T19:56:48.000Z (over 8 years ago)
- Last Synced: 2025-09-18T11:28:15.167Z (10 months ago)
- Topics: device-detection, ios, react-native
- Language: JavaScript
- Homepage:
- Size: 159 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-devices
React Native helper for iOS devices.
### Usage
```javacript
yarn add react-native-devices
```
```javacript
import { devices} from 'react-native-devices'
```
#### IF\_ (function) returns a or b:
```javacript
/* Check if iPhoneX, if not - check if iPhone Plus, else others */
```
#### IS\_ (bool)
```javacript
const top = device.IS_X ? 100 : 0
```
### Helpers
| Functions | arguments | comments |
| ------------------- | ---------- | ---------------------------- |
| IF_X | if, if not | |
| IF_PLUS_6_6S_7_8 | if, if not | |
| IF_6_6S_7_8 | if, if not | |
| IF_5_5S_5C_SE | if, if not | |
| IF_4_4S | if, if not | |
| IF_2G_3G_3GS | if, if not | |
| IF_TABLET | if, if not | |
| IF_IPAD | if, if not | (Mini, 1st & 2nd Generation) |
| IF_IPAD_MINI | if, if not | (2nd, 3rd & 4th Generation) |
| IF_IPAD_AIR | if, if not | (1st & 2nd Generation) |
| IF_IPAD_RETINA | if, if not | (3rd & 4th Generation) |
| IF_IPAD_PRO | if, if not | (Generic 9.7 / 10.5 / 12.9) |
| IF_IPAD_PRO_9_INCH | if, if not | (9.7 inch) |
| IF_IPAD_PRO_10_INCH | if, if not | (10.5 inch) |
| IF_IPAD_PRO_12_INCH | if, if not | (12.9 inch) |
| Bools |
| ------------------- |
| IS_X |
| IS_PLUS_6_6S_7_8 |
| IS_6_6S_7_8 |
| IS_5_5S_5C_SE |
| IS_4_4S |
| IS_2G_3G_3GS |
| IS_TABLET |
| IS_IPAD |
| IS_IPAD_MINI |
| IS_IPAD_AIR |
| IS_IPAD_RETINA |
| IS_IPAD_PRO |
| IS_IPAD_PRO_9_INCH |
| IS_IPAD_PRO_10_INCH |
| IS_IPAD_PRO_12_INCH |
### Why?
There are others out there (like the syntax inspiration for RND - react-native-iphone-x-helper).
Difference is this one gives you more stuff.