A set of React components created by, and for, Mavenlink. See all the available components at our Github Page.
-
Install with NPM or Yarn
npm install --save @mavenlink/design-system # or yarn add @mavenlink/design-system -
Setup React JSX processing. One way of doing that is with
babel-loaderfor Webpack. -
Setup CSS modules. One way of doing that is with
style-loaderfor Webpack andcss-loaderfor Webpack. -
Setup SVG processing. One way of doing that is with
svg-sprite-loaderfor Webpack.// Webpack configuration const SpriteLoaderPlugin = require('svg-sprite-loader/plugin'); module.exports = { module: { rules: [{ test: /\.jsx?$/, use: [{ loader: 'babel-loader', }], }, { test: /\.css$/, use: [{ loader: 'style-loader' }, { loader: 'css-loader', options: { modules: true }, }], }, { test: /\.svg$/, use: [{ loader: 'svg-sprite-loader', }], }], }, plugins: [ new SpriteLoaderPlugin(), ], };
-
Use in your project
import Input from '@mavenlink/design-system/src/components/input/input.jsx'; function App() { return <Input id="hello!" />; }
We periodically update and upgrade styles. We have also created linters to help with those changes! To use, do the following:
-
Install stylelint into your project
-
In your stylelint configuration file (
.stylelintrc.json, .stylelintrc, stylelint.config.js) include the following:const path = require('path'); module.exports = { // ... stylelint configuration ... plugins: [ // ... path.resolve('@mavenlink/design-system/src/linters/colors.js'), ], // ... rules: [ // ... 'mds/colors': true, ], };
-
Run stylelint to see failures