To utilize mdui in Angular, you must first complete the installation of mdui. Following this, additional configuration is required.


The first step is to enable the use of Web Components in Angular. This can be achieved by adding the CUSTOM_ELEMENTS_SCHEMA to the schemas array in your module.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

import { AppComponent } from './app.component';

  declarations: [AppComponent],
  imports: [BrowserModule],
  providers: [],
  bootstrap: [AppComponent],
export class AppModule {}

Once this is set up, you can import mdui components into your Angular component code.

import { Dialog } from 'mdui/components/dialog.js';

  selector: 'app-dialog-example',
  template: `<div id="page">
    <button (click)="openDialog()">Open Dialog</button>
    <mdui-dialog #dialog primary="Dialog Title">Dialog Content</mdui-dialog>
export class DialogExampleComponent implements OnInit {

  // Use @ViewChild to get a reference to the #dialog element
  dialog?: ElementRef<Dialog>;


  constructor(...) {

  ngOnInit() {


  openDialog() {
    // Use nativeElement to access the mdui component
    this.dialog? = true;
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