Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/haxe-react/haxe-react-media

CSS media queries for Haxe React.
https://github.com/haxe-react/haxe-react-media

haxe media-queries reactjs

Last synced: about 1 month ago
JSON representation

CSS media queries for Haxe React.

Awesome Lists containing this project

README

        

# Haxe react media

A haxe-only version of the
[`react-media`](https://www.npmjs.com/package/react-media) npm package, a CSS
media query component for React..

A `` component listens for matches to a CSS media query and renders
stuff based on whether the query matches or not.

## Getting Started

### Installing

```
haxelib install react-media
```

No need for the npm package, this version is haxe-only.

### Usage with React

```haxe
import react.ReactComponent;
import react.ReactMacro.jsx;
import react.media.Media;

class MyComponent extends ReactComponent {
override public function render() {
return jsx('


<$Media query="(min-width: 42em)">

The answer


$Media>

');
}
}
```

See [React-Training/react-media](https://github.com/ReactTraining/react-media)
for more documentation.