UNPKG

3.6 kBMarkdownView Raw
1<p align=center>
2 <img src="https://user-images.githubusercontent.com/36158/53582039-04dd2d00-3b7f-11e9-8460-803ed3b84cc6.png" alt="aragonUI">
3</p>
4
5## Overview
6
7aragonUI is a React library used to build user interfaces for Aragon and its related projects. It provides the components needed to build experiences that feel integrated with Aragon ecosystem, and can be used both client or server side.
8
9The complete documentation can be found on the [aragonUI website](https://ui.aragon.org/).
10
11## Getting Started
12
13If you are unfamiliar with aragonUI, we recommend you to start with the [getting started page](https://ui.aragon.org/getting-started/). If you only want to know how to add aragonUI to your project, have a look at the quick setup:
14
15### Quick setup
16
17Install aragonUI alongside styled-components from npm:
18
19```sh
20npm install --save @aragon/ui styled-components
21```
22
23Copy its assets into your public directory:
24
25```sh
26npx copy-aragon-ui-assets ./public
27```
28
29Wrap your app with the `Main` component:
30
31```jsx
32import React from 'react'
33import { Main } from '@aragon/ui'
34
35function App() {
36 return (
37 <Main>
38 <h1>Hello aragonUI!</h1>
39 </Main>
40 )
41}
42```
43
44_Your project is now ready to use aragonUI. 💫_
45
46Open https://ui.aragon.org/ to see the list of the available components and learn how to use them.
47
48### Assets
49
50aragonUI require some assets (e.g. fonts) in order to work properly. These need to be copied where they can be accessed by the library, like the `public/` directory of a project using [Create React App](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-assets-outside-of-the-module-system).
51
52Copy these assets using the provided `copy-aragon-ui-assets` command:
53
54```sh
55npx copy-aragon-ui-assets ./public
56```
57
58By default, it will create a directory named `aragon-ui` in the specified directory.
59
60This emplacement is communicated to the library through the `<Main>` component. The default path is `./aragon-ui/`, but you can change it using the `assetsUrl` prop:
61
62```jsx
63import { Main } from '@aragon/ui'
64
65const App = () => (
66 <Main assetsUrl="http://example.com/aragon-ui-assets/">
67 <h1>Hello aragonUI!</h1>
68 </Main>
69)
70```
71
72You may also want to add it as a build step in your project, so that aragonUI can be upgraded without having to worry about this.
73
74```json
75"scripts": {
76 "sync-assets": "copy-aragon-ui-assets ./public",
77 "build": "npm run sync-assets && react-scripts build",
78 "start": "npm run sync-assets && react-scripts start"
79}
80```
81
82See `copy-aragon-ui-assets -h` for more information.
83
84## Build and Develop
85
86Please have a look at [CONTRIBUTING.md](CONTRIBUTING.md).
87
88## Projects using aragonUI
89
90- [Aragon client](https://github.com/aragon/aragon) and [core apps](https://github.com/aragon/aragon-apps)
91- [Autark’s Open Enterprise](https://www.autark.xyz/apps)
92- [1Hive’s Dandelion apps](https://github.com/1Hive/dandelion-template)
93- [Aragon Black’s Fundraising](https://fundraising.aragon.black/)
94- [pando](https://github.com/pandonetwork/pando)
95- [P2P Models Wiki](https://github.com/P2PModels/wiki)
96- [Auction App for Cyber Foundation](https://github.com/cybercongress/aragon-auction-app)
97- [1Hive’s Apiary](https://github.com/1Hive/apiary)
98- [Uniswap Aragon App](https://github.com/empowerthedao/uniswap-aragon-app)
99- [Compound Aragon App](https://github.com/empowerthedao/compound-aragon-app)
100- [Aragon Parliament](https://github.com/PeterMPhillips/aragon-parliament)
101- [Aragon Market](https://github.com/proofoftom/aragon-market)
102
103## License
104
105MIT, see [LICENSE](LICENSE).