pirelenito / react-device-simulator

Device simulator for React components

Home Page:https://www.npmjs.com/package/react-device-simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Device Simulator

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

Example

Instalation 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')
)

About

Device simulator for React components

https://www.npmjs.com/package/react-device-simulator


Languages

Language:JavaScript 65.6%Language:CSS 28.8%Language:HTML 5.7%