Skip to content

AutarkLabs/aragon-ui

 
 

Repository files navigation

aragonUI

Overview

aragonUI 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.

Used by:

Getting Started

Quick setup

Install it from npm:

npm install --save @aragon/ui

Copy its assets into your public directory:

npx copy-aragon-ui-assets ./public

Wrap your app with the Main component:

import { Main } from '@aragon/ui'

const App = () => (
  <Main>
    <h1>Hello Aragon UI!</h1>
  </Main>
)

Your project is now ready to use aragonUI. 💫

Open https://ui.aragon.org/ to see the list of the available components and learn how to use them.

Assets

aragonUI 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.

Copy these assets using the provided copy-aragon-ui-assets command:

npx copy-aragon-ui-assets ./public

By default, it will create a directory named aragon-ui in the specified directory.

This 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:

import { Main } from '@aragon/ui'

const App = () => (
  <Main assetsUrl="http://example.com/aragon-ui-assets/">
    <h1>Hello Aragon UI!</h1>
  </Main>
)

You 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.

"scripts": {
  "sync-assets": "copy-aragon-ui-assets ./public",
  "build": "npm run sync-assets && react-scripts build",
  "start": "npm run sync-assets && react-scripts start"
}

See copy-aragon-ui-assets -h for more information.

Build & Develop

Clone this repository, install the dependencies:

npm install

Build:

npm run build

Auto rebuild:

npm run dev

Run the devbox (to develop a component in isolation):

cd devbox
npm install
npm start

License

MIT, see LICENSE.

Packages

No packages published

Languages

  • JavaScript 99.8%
  • HTML 0.2%