id |
---|
instructure-ui |
- Internet Explorer 11 and Edge
- Chrome, Safari, Firefox (last two versions)
Instructure-UI has a number of beautiful and accessible React components with baked-in styles and theming and helpful utility functions.
To start using Instructure-UI React components, you must do the following:
- Activate a style theme.
- Import and render an Instructure-UI component.
To get the default styles as shown in the examples, use the pre-built Canvas theme.
Example:
$ yarn add @instructure/ui-themes @instructure/ui-elements
import React, { Component } from 'react'
import theme from '@instructure/ui-themes/lib/canvas'
import Heading from '@instructure/ui-elements/lib/components/Heading'
theme.use()
class App extends Component {
render() {
return (
<div className="App">
<Heading>Now using Instructure-UI components with default Canvas theme!</Heading>
</div>
)
}
}
export default App
Before contributing please read our code of conduct
You'll need to have Git installed on your system.
We use Lerna to manage inter-package dependencies in this monorepo.
Prerequisites: Node.js v8+, Yarn v1.1.0+
Installation steps:
- Install Git.
- Install Node) and nvm.
- Install Yarn.
- Clone this repository:
git clone gerrit:instructure-ui
. - Run
cd instructure-ui
- Run
yarn
- Run
yarn bootstrap
Run yarn run
to list the available commands.
- Run
yarn start
- Open http://localhost:8001 in your browser
- Run
yarn build:watch
to build all of the packages for a development environment and watch for changes. - Run
yarn start:watch
to start the dev server to run/develop examples and documentation. You can then visit http://localhost:8080 in a browser. When you make changes to the source code you should see the page auto-reload. - Run
yarn test:watch --scope @instructure/[package name]
to run the tests for 'package name' and watch for changes. - Run
yarn test
to run all the tests for every package.
yarn add <package-name>
oryarn upgrade <package-name>
.- Commit the result.
- Update the relevant
package.json
file. Make sure to retain the^
semver range. - Run
yarn bootstrap
and commit the result.
Linting is run as part of the build. If you use the Sublime Text, Atom, or VSCode editors, you can set up the following plugins to catch linting and formatting errors earlier.
- Install the Linter plugin Sublime, Atom. Linting is included in VSCode.
- Install the EditorConfig plugin Sublime, Atom, VSCode
- Install the Eslint plugin Sublime, Atom, VSCode
- Install the Stylelint plugin Sublime, Atom, VSCode
- Run
yarn
to install the dependencies - Restart your editor
- Run
yarn commit
to commit your changes and follow our commit message format. - Please do not include the output of
yarn build
in your commits.
Please update the documentation and examples with any changes, the code and docs should always be in sync.