1.0.0 • Published 6 years ago

react-native-dimensions-breakpoints v1.0.0

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

react-native-dimensions-breakpoints

Allows code to make decisions based on named "breakpoints"

Uses the smaller size from the width or height of the window for calculations. Uses the display pixels of the devices, not pixels.

npm install --save react-native-dimensions-breakpoints

Example

import Breakpoints from "react-native-dimensions-breakpoints";

Breakpoints.configure({
	iphone: 375,
	ipad: 768,
});

if(Breakpoints.smallerThan("iphone"))
	console.log("On a tiny mobile device");

if(Breakpoints.largerThan("ipad))
	console.log("Might be an iPad pro or some huge tablet");