0.5.2 • Published 7 years ago

swipeable-toasts v0.5.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Installation & Usage

After installing the component via npm install, simply add the files to your app.module.ts

import {SwipeableToastComponent, SwipeableToastModule, SwipeableToastProvider} from "swipeable-toasts";

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...,
    SwipeableToastModule
  ],
  bootstrap: [IonicApp],
  entryComponents: [
      ...,
      SwipeableToastComponent
  ],
  providers: [
      ...,
      SwipeableToastProvider
  ]
})

Modify app.html for global usage of SwipeableToasts.

<swipeable-toast-component></swipeable-toast-component>
<ion-nav [root]="rootPage"></ion-nav>

Call the showToast() method by injecting the SwipeableToastProvider

constructor(private swipeableToastProvider: SwipeableToastProvider) { ... }

Define options and show toasts:

 let toastOptions = {
  message: "This is a very important message.",
  messageType: MessageType.SUCCESS,
  duration: 3000,
  cssClass: "custom-css",
  margin: 20
};

this.swipeableToastProvider.showToast(toastOptions);

Choose between different message types

MessageType.ERROR
MessageType.WARNING
MessageType.INFO
MessageType.SUCCESS

Options

OptionTypeDescription
messagestringThe displayed message
messageTypeenumAdds predefined styles to the toasts.
durationnumber?Defines, how long a Toast will be shown, before disappears
cssClassstring?Name of a custom CSS class (e.g. for custom colors)
marginnumber?Defines a margin, which might help for adjusting the toasts in your app.
0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.24

7 years ago

0.3.23

7 years ago

0.3.22

7 years ago

0.3.21

7 years ago

0.3.20

7 years ago

0.3.19

7 years ago

0.3.18

7 years ago

0.3.17

7 years ago

0.3.16

7 years ago

0.3.15

7 years ago

0.3.14

7 years ago

0.3.13

7 years ago

0.3.12

7 years ago

0.3.11

7 years ago

0.3.10

7 years ago

0.3.9

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago