Code Monkey home page Code Monkey logo

aura-toaster's Introduction

aura-toaster

A fluent api wrapper for the lightning:notificationsLibrary.

Methods

notice, sticky, and pester all return the aura component instance so you can chain your call into the message.

Name Return Type Arguments Description
notice toaster header: String Modifier. The next message will be invoked as an SLDS Alert
sticky toaster - Modifier. The next message will be invoked as a sticky toast
pester toaster - Modifier. The next message will be invoked as a pester toast
error undefined title: String, message: String Message. Fires an error message provided title and message.
info undefined title: String, message: String Message. Fires an info message provided title and message.
success undefined title: String, message: String Message. Fires a success message provided title and message.
warning undefined title: String, message: String Message. Fires a warning message provided title and message.

Usage

<!-- MyComponent.cmp -->
<aura:component description="myComponent">
  <c:Toaster aura:id="toaster" />
</aura:component>
// MyComponentController.js
({
  myFunction: function(cmp, event, helper) {
    const toaster = cmp.find('toaster')

    toaster.notice('heading text').error('title', 'message') // => A Javascript Alert like dialogue that must be excused by mouse click with Error style.
    toaster.sticky().warning('title', 'message') // => A sticky toast with warning style.
    toaster.pester().info('title', 'message') // A toast that may not be excused, but fades after 3 seconds with info style.
    toaster.success('title', 'message') // A default success toast.
  }
})

aura-toaster's People

Contributors

justin-lyon avatar

Watchers

 avatar

Forkers

codecaesar

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.