Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-bluekit

Package Overview
Dependencies
Maintainers
2
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bluekit

Visualisation and Playground generated from Components

  • 0.2.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-92.59%
Maintainers
2
Weekly downloads
 
Created
Source

React BlueKit CircleCI

BlueKit usage

BlueKit automatically generates a library from your React components with editable props and live preview.

Point BlueKit to folders with your React components and it will generate a library for you. You'll be able to browse through the components, tweak their props, and see the changes live. Furthermore, any changes that you make to your components' code will be reflected in the library.

DEMO here: http://bluekit.blueberry.io

Install

$ npm install --save react-bluekit

Gulpfile configuration

import createBlueKit from 'react-bluekit/lib/createBlueKit';

createBlueKit({
  // your directory where components are located
  baseDir: `${__dirname}/src/browser`,
  // relative paths from base dir where to look for components
  paths: ['./components/', './auth']
});

This will provide you with two gulp tasks: build-bluekit and watch-bluekit, which perform static analysis of your components.

You can setup the build of BlueKit on application start and then watch components for changes by editing the default task to:

// from gulp.task('default', ['server']); to:
gulp.task('default', ['build-bluekit', 'server', 'watch-bluekit']);

Do not forget to add it to build process (for example on stage or production):

gulp.task('build', ['build-bluekit', 'build-webpack']);
// make sure that component build is before webpack

It will be built when needed.

Add it to your project

Look at the example directory, you only need to add:

import BlueKit from 'react-bluekit';
import componentsIndex from '../componentsIndex';
import React, { Component } from 'react';

export default class PageWithBlueKit extends Component {
  render() {
    return (
      <BlueKit
        componentsIndex={componentsIndex}
        inline // display inline (not full page)
      />
    );
  }
}

You can also pass children to BlueKit, which will be displayed above the search field (e.g. for themes or other stuff).

To add component's description under its name see example example_components/Checkbox.react.js.

BlueKit development

npm install
cd ./example
npm install
gulp
open http://127.0.0.1:8001

This will start the development server and then you can play with components in BlueKit.

Gulp tasks

# generate svg icons from src/icons directory
gulp svg-icon

# run unit tests
gulp ava

If you get some kind of weird error and BlueKit doesn't load at all, try to reset localStorage by running localStorage.clear();. We are working on automatic checks of localStorage values.

License

MIT © Ondrej Bartas

Keywords

FAQs

Package last updated on 12 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc