[go: nahoru, domu]

Skip to content

walshgf/pivotal-ui

 
 

Repository files navigation

NPM

Welcome to Pivotal UI

Build pipeline

Pivotal UI is a collection of React components that are styled for the Pivotal brand. Visit the live styleguide here.

Starting with Pivotal UI

We've created two starter projects to help transitioning to Pivotal UI and React.

Using Pivotal UI - React Components

Environment

We assume your project has the following:

  • node/npm
  • A module loader such as Webpack or Browserify - Pivotal UI modules follow the CommonJS pattern
  • A JSX transpiler such as Babel - Pivotal UI components are written in JSX
  • React - Pivotal UI components are React components

Install

  1. cd /path/to/your/web/assets
  2. npm init
  3. npm install --save pivotal-ui

Usage

Javascript:

import React from 'react';
import {DefaultButton} from 'pivotal-ui/react/buttons';

class MyTestPage extends React.Component {
 getInitialState() {
   return {showMessage: false};
 }

 showMessage() {
   this.setState({showMessage: true});
 }

 render() {
   return (
     <div className="container">
       <DefaultButton  Message</DefaultButton>
       { this.state.showMessage ? <h1>Hello world!</h1> : null }
     </div>
   );
 }
}

ReactDOM.render(<MyTestPage />, document.getElementById('root'));

HTML:

<html>
<body>
    <div id="root"></div>
    <script src="<path-to-your-project's-compiled-javascript-file>"></script>
</body>
</html>

Maintainers

See MAINTAINERS.md.

Contributing

Please refer to our contribution guidelines

Copyright Notice

Copyright 2017 Pivotal Software, Inc. All Rights Reserved.

Packages

No packages published

Languages

  • JavaScript 80.4%
  • CSS 19.5%
  • Other 0.1%