Top Related Projects
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
Semantic is a UI component framework based around useful principles from natural language.
The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
A lightweight and modular front-end framework for developing fast and powerful web interfaces
Modern CSS framework based on Flexbox
A utility-first CSS framework for rapid UI development.
Quick Overview
Material Design Lite (MDL) is a lightweight implementation of Google's Material Design principles for web projects. It provides a set of reusable UI components and styles that follow Material Design guidelines, allowing developers to create modern, visually appealing websites with minimal effort.
Pros
- Easy to integrate into existing projects without complex dependencies
- Lightweight and fast-loading, improving overall performance
- Cross-browser compatible, ensuring consistent appearance across different platforms
- Follows Material Design principles, providing a familiar and user-friendly interface
Cons
- No longer actively maintained, with the last update in 2018
- Limited set of components compared to more comprehensive Material Design libraries
- Lacks advanced features and customization options found in newer alternatives
- May not fully comply with the latest Material Design specifications
Code Examples
- Adding a button with a ripple effect:
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect">
Button
</button>
- Creating a simple card component:
<div class="mdl-card mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Card Title</h2>
</div>
<div class="mdl-card__supporting-text">
Card content goes here.
</div>
<div class="mdl-card__actions mdl-card--border">
<a class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Action
</a>
</div>
</div>
- Implementing a responsive grid layout:
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col">Column 1</div>
<div class="mdl-cell mdl-cell--4-col">Column 2</div>
<div class="mdl-cell mdl-cell--4-col">Column 3</div>
</div>
Getting Started
To use Material Design Lite in your project, follow these steps:
- Include the MDL CSS and JavaScript files in your HTML:
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
- Add the
mdl-js-layout
class to your<body>
tag:
<body class="mdl-js-layout">
<!-- Your content here -->
</body>
- Start using MDL components in your HTML by adding the appropriate classes:
<button class="mdl-button mdl-js-button mdl-button--raised">
Get Started
</button>
Competitor Comparisons
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
Pros of Bootstrap
- More extensive component library and customization options
- Larger community and ecosystem, with numerous third-party themes and plugins
- Better browser compatibility, including support for older versions
Cons of Bootstrap
- Heavier file size, potentially impacting page load times
- Less opinionated design, requiring more effort to achieve a unique look
- Steeper learning curve due to more complex class structure and options
Code Comparison
Material Design Lite:
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">
Button
</button>
Bootstrap:
<button type="button" class="btn btn-primary">
Button
</button>
Both frameworks offer easy-to-use button components, but Material Design Lite uses more specific class names that align with its design principles. Bootstrap's class names are more generic, allowing for easier customization but potentially requiring more classes for advanced styling.
Material Design Lite focuses on implementing Google's Material Design guidelines, providing a cohesive and modern look out of the box. Bootstrap, on the other hand, offers a more flexible foundation that can be adapted to various design styles, making it suitable for a wider range of projects.
Semantic is a UI component framework based around useful principles from natural language.
Pros of Semantic-UI
- More comprehensive UI framework with a wider range of components
- Highly customizable with theming support
- Better integration with JavaScript frameworks like React
Cons of Semantic-UI
- Larger file size and potentially slower load times
- Steeper learning curve due to its extensive features
- Less frequent updates and maintenance compared to Material Design Lite
Code Comparison
Semantic-UI button:
<button class="ui button">
Follow
</button>
Material Design Lite button:
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect">
Follow
</button>
Summary
Semantic-UI offers a more comprehensive and customizable UI framework, making it suitable for complex projects with diverse design requirements. However, it comes with a larger file size and a steeper learning curve. Material Design Lite, on the other hand, provides a lightweight solution that adheres to Google's Material Design principles, making it easier to implement but with fewer customization options. The choice between the two depends on project requirements, design preferences, and performance considerations.
The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
Pros of Foundation
- More customizable and flexible, allowing for greater design freedom
- Extensive grid system with support for complex layouts
- Larger ecosystem with additional plugins and extensions
Cons of Foundation
- Steeper learning curve due to more complex structure
- Larger file size, potentially impacting page load times
- Less consistent with Google's design language
Code Comparison
Material Design Lite:
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect">
Button
</button>
Foundation:
<button class="button large">
Button
</button>
Additional Notes
Material Design Lite follows Google's design guidelines, offering a cohesive look and feel. It's lighter and easier to implement but less flexible. Foundation provides more control over design elements and layout but requires more effort to achieve a consistent appearance across projects.
Both frameworks are responsive and mobile-first, but Foundation's grid system is more advanced. Material Design Lite is better suited for projects aiming to adhere to Google's design language, while Foundation is ideal for custom designs and complex layouts.
A lightweight and modular front-end framework for developing fast and powerful web interfaces
Pros of UIkit
- More comprehensive component library with a wider range of UI elements
- Highly customizable with SASS variables and mixins
- Responsive grid system with support for complex layouts
Cons of UIkit
- Larger file size and potentially slower load times
- Steeper learning curve due to more extensive documentation
- Less recognizable design language compared to Material Design
Code Comparison
UIkit:
<div class="uk-card uk-card-default">
<div class="uk-card-header">
<h3 class="uk-card-title">Card Title</h3>
</div>
<div class="uk-card-body">
<p>Card content</p>
</div>
</div>
Material Design Lite:
<div class="mdl-card mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Card Title</h2>
</div>
<div class="mdl-card__supporting-text">
Card content
</div>
</div>
Both frameworks offer card components, but UIkit's implementation provides more flexibility in terms of styling and layout options. Material Design Lite's approach adheres more strictly to Google's Material Design guidelines, resulting in a more consistent look across projects using the framework.
Modern CSS framework based on Flexbox
Pros of Bulma
- More flexible and customizable, allowing for easier adaptation to various design needs
- Lighter weight and faster to load, with a smaller file size
- More frequent updates and active community support
Cons of Bulma
- Less comprehensive documentation compared to Material Design Lite
- Fewer pre-built components and templates available out-of-the-box
- May require more custom styling to achieve a polished, professional look
Code Comparison
Bulma:
<div class="columns">
<div class="column">
<div class="card">
<div class="card-content">
<p class="title">Card title</p>
<p class="subtitle">Card subtitle</p>
</div>
</div>
</div>
</div>
Material Design Lite:
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col">
<div class="mdl-card mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">Card title</h2>
</div>
<div class="mdl-card__supporting-text">Card subtitle</div>
</div>
</div>
</div>
Both frameworks offer clean and readable syntax, but Bulma's approach is generally more concise and uses simpler class names. Material Design Lite follows Google's design guidelines more closely, which may be preferable for projects aiming to maintain a consistent Material Design aesthetic.
A utility-first CSS framework for rapid UI development.
Pros of Tailwind CSS
- Highly customizable and flexible, allowing for rapid UI development
- Utility-first approach enables quick styling without leaving HTML
- Smaller file size when properly configured, leading to faster load times
Cons of Tailwind CSS
- Steeper learning curve due to numerous utility classes
- Can lead to cluttered HTML with many classes on elements
- Requires additional setup and configuration for optimal use
Code Comparison
Material Design Lite:
<button class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored">
Button
</button>
Tailwind CSS:
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
Button
</button>
Summary
Tailwind CSS offers more flexibility and customization options compared to Material Design Lite, but comes with a steeper learning curve. Material Design Lite provides a more opinionated design system out of the box, while Tailwind CSS allows for more unique designs. The code comparison shows how Tailwind CSS uses multiple utility classes to style elements, whereas Material Design Lite relies on predefined component classes.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Material Design Lite
An implementation of Material Design components in vanilla CSS, JS, and HTML.
Material Design Lite (MDL) lets you add a Material Design look and feel to your static content websites. It doesn't rely on any JavaScript frameworks or libraries. Optimized for cross-device use, gracefully degrades in older browsers, and offers an experience that is accessible from the get-go.
Limited support
Material Design Lite is now in limited support, with development having moved to the Material Components for the web repository.
No further development is taking place in MDL by the core team, but we are happy to review PRs, fix critical bugs and push out new releases. No breaking changes will be accepted.
Use MDL on your site?
This document is targeted at developers that will contribute to or compile MDL. If you are looking to use MDL on your website or web app please head to getmdl.io.
Browser Support
IE9 | IE10 | IE11 | Chrome | Opera | Firefox | Safari | Chrome (Android) | Mobile Safari |
---|---|---|---|---|---|---|---|---|
B | A | A | A | A | A | A | A | A |
A-grade browsers are fully supported. B-grade browsers will gracefully degrade to our CSS-only experience.
Download / Clone
Clone the repo using Git:
git clone https://github.com/google/material-design-lite.git
Alternatively you can download this repository.
Windows users, if you have trouble compiling due to line endings then make sure
you configure git to checkout the repository with lf
(unix) line endings. This
can be achieved by setting core.eol
.
git config core.eol lf
git config core.autocrlf input
git rm --cached -r .
git reset --hard
Remember, the master branch is considered unstable. Do not use this in production. Use a tagged state of the repository, npm, or bower for stability!
Feature requests
MDL is currently in limited support mode, with no further development taking place by the core team. We are happy to accept and review pull requests for new functionality, however, as long as there are no breaking changes.
Want to contribute?
If you found a bug, have any questions or want to contribute. Follow our guidelines, and help improve the Material Design Lite. For more information visit our wiki.
Please use the default branch, mdl-1.x
.
Take note that Material Components for Web, which is MDL v2, is under early Alpha stages (which means everything is a moving target, and we can change anything at any moment). Use with caution.
However, we would absolutely love to have people testing MCW and provide feedback about their experiences using it, especially integrating with other frameworks and libraries.
License
© Google, 2015. Licensed under an Apache-2 license.
Top Related Projects
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
Semantic is a UI component framework based around useful principles from natural language.
The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
A lightweight and modular front-end framework for developing fast and powerful web interfaces
Modern CSS framework based on Flexbox
A utility-first CSS framework for rapid UI development.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot