Material Design Light (MDL) is a library of components for web developers based on Google’s Material Design philosophy: “A visual language for our users that synthesizes the classic principles of good design with the innovation and possibility of technology and science.” Understanding the goals and principles of Material Design is critical to the proper use of the MDL components. If you have not yet read the Material Design Introduction, you should do so before attempting to use the components.
The MDL component library includes new versions of common user interface controls such as buttons, check boxes, and text fields, adapted to follow Material Design concepts. The library also includes enhanced and specialized features like cards, column layouts, sliders, spinners, tabs, typography, and more.
MDL is free to download and use, and may be used with or without any build library or development environment (such as Material Design Lite). It is a cross-browser, cross-OS web developer’s toolkit that can be used by anyone who wants to write more productive, portable, and — most importantly — usable web pages.
To obtain the components, clone or download the GitHub MDL repository. Copy the entire package (the top-level folder and everything below it) to the project folder where you will write your HTML pages. This ensures that your project can access all of MDL’s components and assets, and that you always have the original files for reference in case you break something. :-)
<link rel="stylesheet" href="css/material.min.css"> <script src="js/material.min.js"></script> <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
That’s it! You are now ready to use the MDL components.
In general, follow these basic steps to use an MDL component in your HTML page.
<ul>, depending on the MDL component you want to use. This establishes the element in the page and readies it for MDL modification.
mdl-tabs__panelagain depending on the component. The classes apply the MDL enhancements to the element and effectively turn it into an MDL component.
A note about HTML elements and MDL CSS classes Material Design Lite uses CSS independent classes, which can apply to any HTML element, to construct components. For some components, you can use almost any element. For other components, some elements give better visual or behavioral performance than others. The examples in each component’s README file use elements that perform well as that component. If you must use elements other than those shown in the examples, we encourage you to experiment to find the best combination of HTML elements and MDL CSS classes for your application.
Detailed instructions for using the components, including MDL classes and their effects, coding considerations, and configuration options, can be found in each component’s
README.md file. Working examples using various options are in each component’s
Copyright Google, 2015. Licensed under an Apache-2 license.