Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/kiurchv/react-native-web-responsive

Universal media queries for React Native and web
https://github.com/kiurchv/react-native-web-responsive

media-query react react-native responsive web

Last synced: 4 days ago
JSON representation

Universal media queries for React Native and web

Awesome Lists containing this project

README

        

# react-native-web-responsive

Universal media queries for React Native and web.

## Installation

Using npm:

```sh
npm install --save react-native-web-responsive
```

or yarn:

```sh
yarn add react-native-web-responsive
```

## Usage

Since MediaQuery component built on components from [react-responsive](https://github.com/contra/react-responsive) and [react-native-responsive](https://github.com/adbayb/react-native-responsive) it can utilize any props supported by them with next limitations:
1. There is no difference between viewport- and device-based measurements on native.
2. The only supported unit for the resolution property is dppx.
3. Child function, properties `aspectRatio`, `component`, `color`, `colorIndex`, `monochrome`, `scan` and `type` are unsupported on native.

### Example

```jsx
import React from "react";
import { View, Text } from "react-primitives";
import MediaQuery from "react-native-web-responsive";

function ResponsiveExample() {
return (

Device Test!

You are a desktop or laptop

You also have a huge screen



You are a tablet or mobile phone


You are portrait


You are landscape


You are retina


);
}
```

## License

[MIT](https://github.com/kiurchv/react-native-web-responsive/blob/master/LICENSE)