All Projects → GustavoCostaW → ngc-float-button

GustavoCostaW / ngc-float-button

Licence: MIT license
Google Material Design Float Button - Implementation for Angular v4+. Demo: http://bit.ly/2yIya2f

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ngc-float-button

Ngx Ueditor
Angular for Baidu UEditor
Stars: ✭ 169 (+191.38%)
Mutual labels:  angular-components
ngx-mat-timepicker
A true material timepicker
Stars: ✭ 45 (-22.41%)
Mutual labels:  angular-components
g2-angular
Angular for Alipay G2
Stars: ✭ 27 (-53.45%)
Mutual labels:  angular-components
Awesome Ionic2 Components
Should help you to get awesome components and plugins for Ionic2
Stars: ✭ 209 (+260.34%)
Mutual labels:  angular-components
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+4694.83%)
Mutual labels:  angular-components
ng2-expansion-panels
Expansion Panels component for Angular 2
Stars: ✭ 19 (-67.24%)
Mutual labels:  angular-components
Ej2 Angular Ui Components
Syncfusion Angular UI components library offer more than 50+ cross-browser, responsive, and lightweight angular UI controls for building modern web applications.
Stars: ✭ 159 (+174.14%)
Mutual labels:  angular-components
nz-schema-form
ng-zorro-antd form generation based on JSON-Schema
Stars: ✭ 40 (-31.03%)
Mutual labels:  angular-components
ngx-wall
Helps build content editor for note-taking application
Stars: ✭ 78 (+34.48%)
Mutual labels:  angular-components
angular-dual-listbox
Angular 10 component for a dual listbox control.
Stars: ✭ 78 (+34.48%)
Mutual labels:  angular-components
Ng Drag Drop
Drag & Drop for Angular - based on HTML5 with no external dependencies. 🎉
Stars: ✭ 233 (+301.72%)
Mutual labels:  angular-components
Alyle Ui
Minimal Design, a set of components for Angular 9+
Stars: ✭ 234 (+303.45%)
Mutual labels:  angular-components
notus-angular
Notus Angular: Free Tailwind CSS UI Kit and Admin
Stars: ✭ 148 (+155.17%)
Mutual labels:  angular-components
Fc Angular
快速搭建angular后台管理系统的admin template。Fast development platform based on angular8, ng.ant.design built multi-tab page background management system (continuous upgrade) ^_^
Stars: ✭ 171 (+194.83%)
Mutual labels:  angular-components
stream-chat-angular
💬 Angular Chat SDK ➜ Stream Chat. Build a chat app with ease.
Stars: ✭ 23 (-60.34%)
Mutual labels:  angular-components
Fundamental Ngx
Angular components implementation of Fundamental Library Styles guidelines. The library is aiming to provide an Angular implementation of the components designed in Fundamental Library Styles.
Stars: ✭ 166 (+186.21%)
Mutual labels:  angular-components
ngx-sortable
ngx-sortable is an angular sortable list components that support drag and drop sorting
Stars: ✭ 19 (-67.24%)
Mutual labels:  angular-components
ngx-webuploader
Angular for Baidu WebUploader
Stars: ✭ 12 (-79.31%)
Mutual labels:  angular-components
ng2-material-dropdown
Angular 2 Material-like Dropdown Component
Stars: ✭ 38 (-34.48%)
Mutual labels:  angular-components
spinners-angular
Lightweight SVG/CSS spinners for Angular
Stars: ✭ 21 (-63.79%)
Mutual labels:  angular-components

ngc-float-button

Google Material Floating Action Button, Implementation for Angular v4+

Demo

Installation

First, you need to install the npm module:

npm install ngc-float-button --save

Dependencies

Google Material Icons

Angular Material >= beta.12

Angular >= 4.4.4

Usage

1. You need to add the Google Material icons in your index.html:

The Google Material Icons is required by Angular Material component
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Check the Google Material Icons site to see all icons

2. Import the NgcFloatButtonModule in your project:

import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {NgcFloatButtonModule} from 'ngc-float-button';

@NgModule({
    imports: [
        BrowserModule,
        NgcFloatButtonModule
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }
SharedModule

If you use a SharedModule that you import in multiple other feature modules, you can export the NgcFloatButtonModule to make sure you don't have to import it in every module.

@NgModule({
    exports: [
        CommonModule,
        NgcFloatButtonModule
    ]
})
export class SharedModule { }

Finally, you can use ngc-float-button in your Angular project.

Sample

The FAB template

    <ngc-float-button icon="add">
        <ngc-float-item-button icon="person_add" content="float item 1"></ngc-float-item-button>
        <ngc-float-item-button icon="gps_fixed" content="float item 2"></ngc-float-item-button>
        <ngc-float-item-button icon="mode_edit" content="float item 3"></ngc-float-item-button>
    </ngc-float-button>

API

@Input properties

ngc-float-button properties:

  • icon property expects for icon_name listed in Google Material Icons site.

  • [open] property expects for BehaviorSubject type, with this you can open or close the FAB dispatching events.

  • disabled property expects a boolean to toggle if a button is clickable. Defaults to false.

  • color property define the background color and expects a background:{value} valid value. Defaults to #dd0031.

  • direction property expects for string value type value that's accepted top, right, bottom, left. Defaults to top

  • spaceBetweenButtons - property expects a valid number value in px to define the space between each ngc-float-item-button, Defaults to 55

Sample: [open]

    ...
    //our parent component

    // with 'true' our FAB will be started open.
    public open:BehaviorSubject<boolean> = new BehaviorSubject(true); // true is the initial state of FAB

    ...
    <div>
        <button md-button (click)="open.next(true)">Open</button>
        <button md-button (click)="open.next(false)">Close</button>
    </div>

    <ngc-float-button icon="add" [open]="open">
    ...

Sample: [direction]

    <div>
        <button md-button (click)="direction='top'">Top</button>
        <button md-button (click)="direction='right'">Right</button>
        <button md-button (click)="direction='bottom'">Bottom</button>
        <button md-button (click)="direction='left'">Left</button>
    </div>

    <ngc-float-button icon="add" direction="{{direction}}">
    ...

ngc-float-item-button properties:

  • icon property expects for icon_name listed in Google Material Icons site.
  • color property define the background color and expects a background:{value} valid value. Defaults to white.
  • disabled property expects a boolean to toggle if a button is clickable. Defaults to false.
  • content property expects string value to show additional text in ngc-float-item-button

@Output property

You can listen the all events emitted by ngc-float-button subscribing in the (events) observable output.

Sample:

    ...

    output(log) {
        console.log(log);
    }

    ...
    <ngc-float-button (events)="output($event)">
    ...

Customization

If you need change some css property in ngc-float-button you need to use /deep/ selector in parent css component.

More info about customization soon.

CSS animations credits

The css animations were inspired by this

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].