New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-size-classes

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-size-classes

iOS Size Classes for use with React Native

latest
Source
npmnpm
Version
0.3.1
Version published
Weekly downloads
11
-56%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-size-classes

Get the UIKit UIWindow values for UITraitCollection vertical and horizontal size classes in iOS. Safe for Android (it's a no-op).

Installation

Using npm:

npm install --save react-native-size-classes

Using yarn:

yarn add react-native-size-classes

Linking

Automatic

react-native link react-native-size-classes

or with rnpm:

rnpm link react-native-size-classes

Usage

import SizeClasses from 'react-native-size-classes'

API

The API currently supports iOS only. You'll probably want to wrap calls in Platform.OS or Platform.select().

getSizeClasses()

Uses the UIWindow to return a Promise that resolves values for vertialSizeClass and horizontalSizeClass for the overall app.

Examples

SizeClasses.getSizeClasses().then((sc) => console.log(sc.vertical))

isIpad()

Uses the UIWindow value for userInterfaceIdiom to determine if this device is an iPad or not.

Examples

const isIpad = SizeClasses.isIpad(); //true

FAQs

Package last updated on 09 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts