pregiotek / ion-floating-menu

Material UI-like Floating Action Button and Menu for Ionic applications
MIT License
102 stars 43 forks source link

ion-floating-menu

Material UI-like Floating Action Button and Menu for Ionic applications

Features

Setup

Install

bower install ion-floating-menu

JS/CSS Imports (index.html)

Include the following file imports in your index.html (the example assumes ./lib/ion-floating-menu folder):

<link href="https://github.com/pregiotek/ion-floating-menu/blob/master/lib/ion-floating-menu/dist/ion-floating-menu.css" rel="stylesheet" type="text/css"/>
    ...
<script src="https://github.com/pregiotek/ion-floating-menu/raw/master/lib/ion-floating-menu/dist/ion-floating-menu.js" type="text/javascript"></script>

Angular Dependency (app.js)

Add ion-floating-menu as a module dependency of your angular module.

angular.module('MyApp', ['ionic', 'ion-floating-menu'])
  ...

Usage: ionic-floating-button

Alt ion-floating-button

Add the ion-floating-button directive in your template.

Important: put it before and outside the ion-content node:

<ion-floating-button click="myEvent()" has-footer="false" button-color="#2AC9AA" icon="ion-plus" icon-color="#fff">
</ion-floating-button>

<ion-content>
    ...

where myEvent() is trigger when you tap or click.

Config

Usage: ion-floating-menu

Alt ion-floating-menu Alt ion-floating-menu

Add the ion-floating-menu directive in your template.

Important put it before ion-content.

<ion-floating-menu>
    <ion-floating-item icon="ion-camera" click="myEvent()"></ion-floating-item>
    <ion-floating-item icon="ion-person" click="myEvent()"></ion-floating-item>
</ion-floating-menu>

where myEvent() is trigger when you tap or click.

Config

ion-floating-menu:

ion-floating-item:

Events

ion-floating-menu:

For example

$scope.$on('floating-menu:open', function(){
                    ... 
});

Questions?

If you have any question or remark, you can either:

Have fun!