项目作者: JFusco

项目描述 :
React + Webpack based boilerplate for producing React components
高级语言: JavaScript
项目地址: git://github.com/JFusco/react-library-boilerplate.git
创建时间: 2016-10-10T15:38:10Z
项目社区:https://github.com/JFusco/react-library-boilerplate

开源协议:MIT License

下载


react-library-boilerplate

Build Status

peerDependency Status
devDependency Status

MIT
npm

Starter project for creating libraries

Demo

https://jfusco.github.io/react-library-boilerplate

Getting Started

Installation

From the root of your project.

  1. npm install library --save

Usage

Implementation of component. See available options below.

  1. import React, { Component } from 'react';
  2. import { render } from 'react-dom';
  3. render(<Application ></Application>, document.getElementById('application'));

Options

foo ~ required

The foo of the component - used for setting up foo

  1. <Component foo="bar" ></Component>

Styling

Installation

Import the main SCSS file in to your application SCSS files

  1. @import "node_modules/component/src/component/scss/styles.scss";

There are a few variables set to !default that can be overriden. If you need to change it more just override the actual styles.

Any overriden variables needs to go above the @import statement to take effect

  1. //-- Global UI
  2. $component-width

If you don’t care to override variables and just want to override actual styles you may choose to import the minified compiled version of the css instead

  1. @import "node_modules/component/dist/styles.css";

Tests

  1. npm test