Skip to content

bgptr/pi-ui

 
 

Repository files navigation

pi-ui

Build Status

Politeia UI library documentation

NPM JavaScript Style Guide

Install

Make sure you have nodejs 8+ and yarn or npm installed.

yarn

yarn add pi-ui

npm

npm install --save pi-ui

Usage

In the index file of your app make sure to import the styles for the lib:

  • index.js:
import "pi-ui/dist/index.css";
  • Component.js:
import React, { Component } from "react";

import { Button } from "pi-ui";

class Example extends Component {
  render() {
    return <Button />;
  }
}

Developing

  • Clone this repository

  • Install all deps by running: yarn

  • If you're developing only on pi-ui, serving the live documentation should be enough: yarn docz:dev

  • If you want to see your changes reflected in a project consuming pi-ui, you can use yarn link:

    • Go to the pi-ui directory on your machine and run: yarn link
    • Go to the project using pi-ui and run: yarn link pi-ui

Troubleshooting: If you find some kind of incompatibility between react versions, link the react package from the main repository into pi-ui:

  • Go to the main repository which is using the pi-ui lib, access the react folder inside its node_modules:
    • cd /some/project/node_modules/react && yarn link
    • cd /pi-ui && yarn link react

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 81.4%
  • CSS 18.6%