npm install
npm start
npm run build
- Bundling via webpack
- ES6+ Support via babel
- SASS Support via sass-loader
- Linting via eslint-loader
- Unit Testing via jest
- Code Formatting via prettier
├── src
│ ├── img/
│ ├── js/
│ ├── scss/
│ └── index.html
├── webpack
│ ├── webpack.common.js
│ ├── webpack.config.dev.js
│ └── webpack.config.prod.js
└── dist/
You can import the entire library or just individual modules:
import * as mdb from 'mdb-ui-kit'; // lib
import { Input } from 'mdb-ui-kit'; // module
import { Input as CustomInput } from 'mdb-ui-kit'; // module with custom name
To import MDB stylesheet please use the following syntax:
@import '~mdb-ui-kit/css/mdb.min.css';
It is possible to prepare a custom version of MDB UI KIT. It can be useful when the project uses only several modules of our library and you want to reduce the size of the compiled files. To achieve this, follow the steps:
npm install
npm run getMDBsrc
Copy the content from mdb/js/mdb.free.js or mdb/js/mdb.pro.js to src/js/index.js file. Pick only the components you need and update path to the mdb dir. Here's an example:
import Carousel from '../../mdb/js/free/carousel';
export { Carousel };
Same as with js files, copy the content from mdb/scss/mdb.free.scss or mdb/scss/mdb.pro.scss to src/scss/index.scss. Remove the lines with the import of modules that you will not use and update the paths to point the mdb dir.
Add your own content inside index.html file. Keep in mind that you will also need to update js and css file names:
From:
<link rel="stylesheet" href="css/index.min.css" />
<script type="text/javascript" src="js/index.min.js"></script>
To:
<link rel="stylesheet" href="css/mdb.min.css" />
<script type="text/javascript" src="js/mdb.min.js"></script>
npm run startMDB
npm run buildMDB