rv
react-viewport
npm i react-viewport
rv

react-viewport

Build React components with specified view height and width units. Supports fallback values for browsers that do not support vh or vw.

by Joseph Furlott

1.0.6 (see all)License:MITTypeScript:Not Found
npm i react-viewport
Readme

react-viewport

Build React components with specified view height and width units. Supports fallback values for browsers that do not support vh or vw.

$ npm install --save react-viewport

Usage

Just use like you would any other div.

var React = require('react');
var ViewportContainer = require('react-viewport');

var Component = React.createClass({
    render: function() {
        <ViewportContainer
            className="Container"
            height="50vh"
            minWidth="75vw"
        >

            ...

       </ViewportContainer>
    }
});

Breaking changes

viewHeight and viewWidth are no longer supported, and should just be height and width. This change allows greater flexibility to use any css properties such as min-height or min-width.

License

MIT

Downloads/wk

19

GitHub Stars

19

LAST COMMIT

8yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.6
latest
8yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate