You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-responsive-display

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-responsive-display

Conditionally render react components based on common viewport breakpoints.

0.0.1
latest
npmnpm
Version published
Maintainers
1
Created
Source

react-responsive-display

A responsive utility for react components.

Rather than placing a display: none; on an element when it needs to be hidden, react-responsive-display will refrain from rendering the child component into the dom when the viewport width matches the range you've specified.

Props

Required

  • windowSize (number)

Optional

  • hiddenXs (boolean)
  • hiddenSm (boolean)
  • hiddenLg (boolean)
  • hiddenXl (boolean)

Usage

var React = require('react')
var ResponsiveDisplay = require('react-responsive-display');

module.exports = React.createClass({
  render: function() {
    // If the window size passed into this component is less than 768 pixels, it renders nothing.
    return (
      <ResponsiveDisplay hiddenSm={true} windowSize={this.props.windowSize}>
        <h1>Hello, World</h1>
      </ResponsiveDisplay>
    );
  }
});

Keywords

react

FAQs

Package last updated on 20 Feb 2015

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