0.1.7 • Published 7 years ago

react-css-devices v0.1.7

Weekly downloads
32
License
ISC
Repository
github
Last release
7 years ago

react-css-devices

React component for CSS Devices in your project. (NOTE: This project is still work in progress. Marvel Devices are however ready to use. More devices and customization coming soon.)

macbook

Installation

npm install --save react-css-devices

Important Note : You need to have a css-loader installed. for example with webpack

Props

PropsCoolProp Values
deviceName (String)Name of the deviceiphone6, iphone6plus, iphone5s, iphone5c, ipad, iphone4s, nexus5, s5, htc-one, macbook
color (String)Color ( only supported by iphone5c for now )white, black, red, yellow, green, blue
orientation (String)Landscape or portraitlandscape, portrait
transform (Integer)Scale the device to your size ( Size chart below )default is 1

Size Chart

Device1x Portrait Size ( Device )1x Portrait Size ( Screen )
iphone6423x887375x667
iphone6plus466x960414x736
iphone5s364x778320x568
iphone5c364x778320x568
ipad626x948576x768
iphone4s374x738320x480
nexus5350x668320x568
s5356x688320x568
htc-one370x740320x568
macbook1048x720960x600

Examples

To create a black iphone in landscape you do

import { MarvelDevices } from 'react-css-devices'

<MarvelDevices deviceName={"iphone6"}
               color={"black"}
               orientation={"landscape"}
               transform={0.5}>
    
    {/*Paste your content here*/}
    <img src={"http://via.placeholder.com/667x375"}/> 
     
</MarvelDevices>

Credits

Marvel devices

Author

Any suggestions / improvements / critics are welcome. I'm available on @aswinckr

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago