Skip to content

muicss/mui-angular

Repository files navigation

MUI Angular Component Library

MUI Angular

MUI Angular is a library that helps you to add MUI components to your Angular apps seamlessly.

Install with NPM:

$ npm install --save @muicss/angular

Install with ng:

$ ng add @muicss/angular

Quickstart

Create a new Angular app and install MUI Angular

$ ng new my-app
$ cd my-app
$ ng add mui-angular

Add the MUI Angular button module to the app module (src/app/app.module.ts):

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

import { ButtonModule } from '@muicss/angular/button';

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

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ButtonModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Replace the app component html code with the following (src/app/app.component.html):

<mui-button>Press Me!</mui-button>

Run the development server:

$ ng serve

Then visit http://localhost:4200/

Development

This repository contains the source code for the MUI Angular library (projects/mui-angular) and an example app that uses the library (projects/example-app).

To build the library run:

$ ng build @muicss/angular

To view the example app:

$ ng serve example-app

Build

Run ng build to build the library. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build. Use the --watch flag to rebuild the library on code changes.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.