Giter VIP home page Giter VIP logo

uibook's Introduction

Sponsored by Amplifr

Uibook

Uibook is a tool for visual testing of React components. It let you quickly check both desktop and mobile view of your components with real media queries and different combinations of props.

The Key Features:

  • Responsive Testing for developers to play with real media queries
  • Live Text Editing for designers and editors to check their content
  • Installed as a Webpack Plugin, it doesn’t require any additional builder.

Uibook key features

🚩 Check amazing Uibook example here: https://amplifr.com/uikit.

Usage

Quick Install 🐣

We’ve designed Uibook for seamless integration to your project. Install it as a webpack plugin, and you’re all set: Uibook doesn’t require any separate bundler.

webpack.config.js

const UibookPlugin = require('uibook/plugin')

module.exports = {
  
  plugins: [
    new UibookPlugin({
      outputPath: '/uibook',
      controller: path.join(__dirname, '../src/uibook-controller.js')
    })
  ],
}

Read more about installation →

Describe components in Pages 🐥

You should define two things only:

  1. The Page — simple object with test component name and cases;
  2. The Case — set of props and callbacks to the component.

button.uibook.js

import UibookCase from 'uibook/case'
import Button from '../src/button'

export default {
  component: Button,
  name: 'Button',
  cases: [
    () => <UibookCase>Button</UibookCase>,
    () => <UibookCase props={{ isSmall: true }}>Small button</UibookCase>
  ]
}

Read more about configuration →

Pass Pages to the Controller 🐤

As soon as you finished your first Uibook Page, you’re ready to write Uibook Controller. This is a place where all Pages included and passed to UibookStarter ✨

uibook-controller.js

import UibookStarter from 'uibook/starter'
import ButtonUibook from './button.uibook'

export default UibookStarter({
  pages: {
    Button: ButtonUibook
  }
})

Read more about Controller →

Launch 🚀

There is no need in any additional servers or webpack instances. Uibook integrates into your project, so just run your bundler and open /uibook (or your custom address — outputPath) in a browser.

More information

Live Text Editing

This mode enables contentEditable for each case, allowing managers, designers and interface editors to preview content in components.

Text Edit Mode

Special thanks

uibook's People

Contributors

vrizo avatar

Watchers

James Cloos avatar

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.