Politeia UI library documentation
Make sure you have nodejs 8+ and yarn or npm installed.
yarn add pi-ui
npm install --save pi-ui
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 />;
}
}
-
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
- Go to the pi-ui directory on your machine and run:
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