Giter VIP home page Giter VIP logo

mat-progress-buttons's Introduction

Angular Material Design Progress Buttons

Very simple Angular6+ Material Design progress buttons

Build Status npm version GitHub issues

Demo

StackBlitz Demo

Usage

Import in any Angular application by running:

$ npm install --save mat-progress-buttons

Install Angular Material: (Getting Started)

$ npm install --save @angular/material @angular/cdk

Install Angular Animations:

npm install --save @angular/animations

Import a material theme into your style.css file:

@import "~@angular/material/prebuilt-themes/indigo-pink.css";

Then import MatProgressButtons into your AppModule:

import { MatProgressButtons } from 'mat-progress-buttons';

@NgModule({
  imports: [ MatProgressButtons ]
})

export class AppModule { }

That's it! Once imported, you can use the components:

Progress Bar Button:

<progress-bar-button [options]="options" (onClick)="someFunc()"></progress-bar-button>

API:

You can use (click) but a custom onClick handler is provided as well. Which is useful if using the buttons for forms and you need the buttton to be entirely disabled.

@Output() onClick

Button options (see below)

@Input() options

Options:

active: boolean, // is loading
text: string, // button text
buttonColor?: string, // primary/accent/warn
barColor?: string, // primary/accent/warn
raised?: boolean, // raised button
mode?: string, // determinate/intederminate
value?: number // used if mode is determinate
disabled?: boolean // button disabled

Progress Spinner Button:

<spinner-button [options]="options" (onClick)="someFunc()"></spinner-button>

API:

You can use (click) but a custom onClick handler is provided as well. Which is useful if using the buttons for forms and you need the buttton to be entirely disabled.

@Output() onClick

Button options (see below)

@Input() options

Options:

active: boolean, // is loading
text: string, // button text
buttonColor?: string, // primary/accent/warn
spinnerColor?: string, // primary/accent/warn
raised?: boolean, // raised button
mode?: string, // determinate/intederminate
value?: number // used if mode is determinate
fullWidth?: boolean // button will be full width if true
disabled?: boolean // button disabled

Development

Download or clone this repo

run npm install

When you are ready to build, run npm run bundle

License

MIT © Michael Doye

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.