Angular 2 components, directives and styles based on material design lite https://getmdl.io.
npm install angular2-mdl
Angular 2 components, directives and styles based on material design lite https://getmdl.io (v: 1.3.0).
This package assumes that you are building an Angular2 app with TypeScript. Angular CLI makes it even easier but isn't required.
Demo-App with all supported components and documentation









Please don't use github to ask questions. Use stackoverflow instead: http://stackoverflow.com/questions/tagged/angular2-mdl.
Here is a plnkr if you'd like to play around http://plnkr.co/edit/I3dLfLUDIH2xlEJqj0da?p=preview.
- Badges
- Buttons
- Cards
- Chips
- Dialogs (imperative and declarative)
- Icons
- Loading
- Shadow
- Toggle (Checkbox, Radio, Icon Toggle, Switch)
- Lists
- Slider
- Snackbar
- Table
- Tooltips
- Menu
- Layout (standard, scroll, waterfall, tabs)
- Tabs
- Textfields (multiline, expandable)
``bash`
npm install angular2-mdl --save
Just use it. Add the MdlModule to your NgModule imports and you are done!
You need to configure your system-config.js file:
`JavaScript
const map: any = {
'angular2-mdl': 'vendor/angular2-mdl'
};
/* User packages configuration. /
const packages: any = {
'angular2-mdl': { main: 'bundle/angular2-mdl.js'}
};
`
HTML
`
Under http://mseemann.io/angular2-mdl/theme you'll find a customizing tool to change the theme colors.$3
This package includes the scss files from material-design-lite.
With these files you are able to change the colors and other variables in your own scss files:`scss
@import "~angular2-mdl/scss/color-definitions";$color-primary: $palette-blue-500;
$color-primary-dark: $palette-blue-700;
$color-accent: $palette-amber-A200;
$color-primary-contrast: $color-dark-contrast;
$color-accent-contrast: $color-dark-contrast;
@import '~angular2-mdl/scss/material-design-lite';
`To make this working you need to find out the way how you could tell your build system where the scss is located.
For example with webpack you can use the special
~angular2-mdl syntax or you can configure the includePaths:`JavaScript
sassLoader: {
includePaths: [util.root('node_modules', 'angular2-mdl', 'scss')]
}
``Every contribution is welcome. Please checkout the CONRIBUTION.md file.
| angular2-mdl version | metadata version | angular version
| --- | --- | --- |
| 2.7.0 | 1 | <2.3.0
| 2.8.0 | 2 | 2.3.0
| >=2.9.0 | 3 | >=2.3.1
If you need a working example for the current angular-cli with the current angular2-mdl and angular versions please have a look at:
https://github.com/mseemann/a2-mdl-webpack.