You are currently reading the documentation for mdui 2!

For mdui 1 documentation, please visit

Let's begin by incorporating mdui into a basic page template using a CDN.

Getting Started

To use mdui, import the CSS and JS files from the CDN.

For npm installation instructions, refer to the Installation section.

Importing Files

Add the following lines to your page's <head> tag:

<link rel="stylesheet" href="">
<script src=""></script>

To utilize the icon attribute (for example, icon="search" in <mdui-button icon="search"></mdui-button>), include the CSS file for the icon. Refer to Using Material Icons for more information.

mdui operates independently of third-party libraries and is ready to use once the files are included.

Simplest Page Template

Below is the simplest page template. You can add more components and content to build your website.

<!doctype html>
<html lang="zh-CN">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no"/>
    <meta name="renderer" content="webkit"/>

    <link rel="stylesheet" href="">
    <script src=""></script>
    <!-- Include the icon's CSS file if using the icon attribute -->

    <title>Hello, world!</title>
    <mdui-button>Hello, world!</mdui-button>
Preset Colors
Custom Color
Extract Color from Wallpaper
Select a Wallpaper
Getting Started
Introduction Installation Usage TypeScript Support IDE Support Localization Frequently Asked Questions
Dark Theme Dynamic Theme Typography Design Tokens
React Vue Angular
Button ButtonIcon Fab SegmentedButton Chip Card Checkbox Radio Switch Slider RangeSlider List Collapse Tabs Dropdown Menu Select TextField LinearProgress CircularProgress Dialog Divider Avatar Badge Icon Tooltip Snackbar NavigationBar NavigationDrawer NavigationRail BottomAppBar TopAppBar Layout
JavaScript Library dialog alert confirm prompt snackbar getTheme setTheme getColorFromImage setColorScheme removeColorScheme loadLocale setLocale getLocale throttle observeResize breakpoint