UNPKG

2.7 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
9Used by:
10
11- [Aragon](https://github.com/aragon/aragon)
12- [Aragon apps by the core team](https://github.com/aragon/aragon-apps)
13- [aragon.org](https://aragon.org/)
14- [hack.aragon.org](https://hack.aragon.org/)
15
16## Getting Started
17
18### Quick setup
19
20Install it from npm:
21
22```sh
23npm install --save @aragon/ui
24```
25
26Copy its assets into your public directory:
27
28```sh
29npx copy-aragon-ui-assets ./public
30```
31
32Wrap your app with the `Main` component:
33
34```jsx
35import { Main } from '@aragon/ui'
36
37const App = () => (
38 <Main>
39 <h1>Hello AragonĀ UI!</h1>
40 </Main>
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 AragonĀ UI!</h1>
68 </Main>
69)
70```
71
72You may also want to add it as a build step in your project, so that AragonĀ UI 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 & Develop
85
86Clone this repository, install the dependencies:
87
88```sh
89npm install
90```
91
92Build:
93
94```sh
95npm run build
96```
97
98Auto rebuild:
99
100```sh
101npm run dev
102```
103
104Run the devbox (to develop a component in isolation):
105
106```sh
107cd devbox
108npm install
109npm start
110```
111
112## License
113
114MIT, see [LICENSE](LICENSE).