react-device-simulator

1.0.1 • Public • Published

React Device Simulator

React component that allows visualizing a given component in different screen sizes.

Example

Installation and usage

Simply add the package:

yarn add react-device-simulator

And wrap a component that you want to have tested with different screen sizes:

import React from 'react'
import { render } from 'react-dom'
import DeviceSimulator from 'react-device-simulator'
import MyComponent from './my-component'
 
render(
  <div>
    <DeviceSimulator>
      <MyComponent />
    </DeviceSimulator>
  </div>,
  document.getElementById('root')
)

Package Sidebar

Install

npm i react-device-simulator

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

140 kB

Total Files

6

Last publish

Collaborators

  • deschtex