assembly-components
A React component library for building Mapbox things.
This library is new and experimental.
Please try it out and file issues.
Once we are a little more confident in the approach, we will start a changelog.
Until then, pay attention and be careful when you update.
Installation
Install the npm package @mapbox/assembly-components
.
Documentation
Please look at the generated files in docs/
.
Usage
The contents of src/
are compiled with Babel but not bundled.
You should import/require each file you want to use individually, using your own JS build system to bundle in your own way.
import React from 'react';
import { Icon } from '@mapbox/assembly-components/icon';
class MyComponent extends React.Component {
render() {
return (
<div>
<Icon name='check' />
</div>
);
}
}
Development
yarn install
Run the test cases app:
yarn start
Publishing
assembly-components publishes the dist
directory, which is not committed to the repo.
dist/package.json
is generated by picking properties from ./package.json
.
So before publishing, you need to ensure you have updated the version number (and any other relevant info) in ./package.json
.
# Build components into `dist`
yarn build
# Enter the `dist` directory
cd dist
# From the `dist` directory, publish
yarn publish