0.5.2 • Published 6 years ago

swipeable-toasts v0.5.2

Weekly downloads
1
License
MIT
Repository
-
Last release
6 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

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.24

6 years ago

0.3.23

6 years ago

0.3.22

6 years ago

0.3.21

6 years ago

0.3.20

6 years ago

0.3.19

6 years ago

0.3.18

6 years ago

0.3.17

6 years ago

0.3.16

6 years ago

0.3.15

6 years ago

0.3.14

6 years ago

0.3.13

6 years ago

0.3.12

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago