Coder Social home page Coder Social logo

501a-designs / react-mockup Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 775 KB

๐Ÿ–ผ๏ธ Create simple mockups with a single react component

Home Page: https://react-mockup-editor.vercel.app/

HTML 14.36% JavaScript 64.87% CSS 20.77%
react react-component reactjs

react-mockup's Introduction

react-mockup

Create simple mockups with a single react component

NPM JavaScript Style Guide

About

react-mockup lets you create simple mockups with a single react component. This package contains three different components:

  • <WindowMockup/>
  • <BrowserMockup/>
  • <MobileMockup/>

react-mockup also provides a web editor that is still currently under development that allows you to customize your mockup visually without needing to fiddle around with the props. (The editor will generate the nessacary react-mockup component for you). Visit Editor

Install

You can install react-mockup using NPM:

npm install --save react-mockup

Example Usage

import React from 'react'
import {BrowserMockup} from 'react-mockup'
import 'react-mockup/dist/index.css'

function App {
  const frameStyle={
    backdropFilter: 'blur(16px)',
    background:'radial-gradient(86.36% 107.55% at 6.49% 12.32%,rgba(255, 255, 255, 0.5) 0%,rgba(255, 255, 255, 0.5) 100%)',
    border:'1px solid rgba(228, 228, 228, 0.3)',
    padding:'20px',
    borderRadius:'20px',
  }

  return(
    <>
      <h1>React Mockup!</h1>
      <BrowserMockup
        src=""
        type="chrome"
        windowControlPosition="right"
        angleX="5deg"
        angleY="10deg"
        accentColor="orange"
        urlValue="google.com"
        shadow="none"
        border="none"
        color="black"
        frameStyle={frameStyle}
      />
    </>
  )
}

Component Specific Properties

๐Ÿ’ป Window & ๐Ÿ–ฑ๏ธ Browser Mockup

Properties What to insert
src The image of what you want to display in the mockup
type Button aesthetics (Currently accepts 4 types 'default', 'mac', 'chrome' and 'outline')
angleX X angle of the mockup
angleY Y angle of the mockup
shadow Mockups box-shadow property. (Set as 'none' if you do not want to set anything)
border Mockups border property. (Set as 'none' if you do not want to set anything)
color The mockups head color
accentColor The color of the buttons

๐Ÿ’ป Window Mockup

Properties What to insert
windowName The display name of the window mockup
windowControlPosition 'right' or 'left'

๐Ÿ–ฑ๏ธ Browser Mockup

Properties What to insert
frameStyle Freely insert your original styles a div that wraps the mockup component
urlValue The displayed URL value stored in the browser mockup
windowControlPosition 'right' or 'left'

๐Ÿ“ฑ Mobile Mockup [Beta]

Properties What to insert
src The image of what you want to display in the mockup
size The size of the phone mockup (default is '1')
angleX X angle of the mockup
angleY Y angle of the mockup
shadow Mockups box-shadow property. (Set as 'none' if you do not want to set anything)
border Mockups border property. (Set as 'none' if you do not want to set anything)

License

MIT ยฉ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.