Directory

paper-toast - Vaadin Add-on Directory

A Material Design popup toast paper-toast - Vaadin Add-on Directory
[![Published on NPM](https://img.shields.io/npm/v/@polymer/paper-toast.svg)](https://www.npmjs.com/package/@polymer/paper-toast) [![Build status](https://travis-ci.org/PolymerElements/paper-toast.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-toast) [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/paper-toast) ## <paper-toast> `paper-toast` provides a subtle notification toast. Only one `paper-toast` will be visible on screen. Use `opened` to show the toast: Example: ```html ``` Also `open()` or `show()` can be used to show the toast: Example: ```html Open Toast ... openToast: function() { this.$.toast.open(); } ``` Set `duration` to 0, a negative number or Infinity to persist the toast on screen: Example: ```html Show more ``` `` is affected by the [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context) of its container. Adding `` inside elements that create a new stacking context - e.g. ``, `` or `` - might result in toasts partially obstructed or clipped. Add `` to the top level (``) element, outside the structure, e.g.: ```html ``` You can then use custom events to communicate with it from within child components, using `addEventListener` and `dispatchEvent`. ### Styling The following custom properties and mixins are available for styling: | Custom property | Description | Default | | --- | --- | --- | | `--paper-toast-background-color` | The paper-toast background-color | `#323232` | | `--paper-toast-color` | The paper-toast color | `#f1f1f1` | This element applies the mixin `--paper-font-common-base` but does not import `paper-styles/typography.html`. In order to apply the `Roboto` font to this element, make sure you've imported `paper-styles/typography.html`. See: [Documentation](https://www.webcomponents.org/element/@polymer/paper-toast), [Demo](https://www.webcomponents.org/element/@polymer/paper-toast/demo/demo/index.html). ## Usage ### Installation ``` npm install --save @polymer/paper-toast ``` ### In an html file ```html ``` ### In a Polymer 3 element ```js import {PolymerElement, html} from '@polymer/polymer'; import '@polymer/paper-toast/paper-toast.js'; class SampleElement extends PolymerElement { static get template() { return html` `; } } customElements.define('sample-element', SampleElement); ``` ## Contributing If you want to send a PR to this element, here are the instructions for running the tests and demo locally: ### Installation ```sh git clone https://github.com/PolymerElements/paper-toast cd paper-toast npm install npm install -g polymer-cli ``` ### Running the demo locally ```sh polymer serve --npm open http://127.0.0.1:/demo/ ``` ### Running the tests ```sh polymer test --npm ```
Online Demo
View on NPM
Documentation
View on GitHub
GitHub Homepage
Issue tracker
License

paper-toast version 0.8.0
### Dependencies Polymer/polymer#0.8.0-rc.7 * PolymerElements/paper-styles#^0.8.6

paper-toast version 0.9.0
### Dependencies Polymer/polymer#v0.9.0-rc.1 * PolymerElements/paper-styles#^0.9.0

paper-toast version 0.9.1
### Dependencies PolymerElements/paper-styles#^0.9.0 * Polymer/polymer#^0.9.0

paper-toast version 0.9.2
### Dependencies PolymerElements/paper-styles#^0.9.0 * Polymer/polymer#^0.9.0

paper-toast version 0.9.3
### Dependencies PolymerElements/paper-styles#^0.9.0 * Polymer/polymer#^0.9.0 * polymerelements/iron-a11y-announcer#^0.9.0

paper-toast version 1.0.0
### Dependencies * paper-styles#PolymerElements/paper-styles#^1.0.0 * polymer#Polymer/polymer#^1.0.0 * iron-a11y-announcer#polymerelements/iron-a11y-announcer#^1.0.0

paper-toast version 1.0.1-rc
### Dependencies * paper-styles#PolymerElements/paper-styles#^1.0.0 * polymer#Polymer/polymer#^1.0.0 * iron-a11y-announcer#polymerelements/iron-a11y-announcer#^1.0.0

paper-toast version 1.1.0
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#~1.0.9 * paper-styles#PolymerElements/paper-styles#^1.0.0 * polymer#Polymer/polymer#^1.1.0

paper-toast version 1.1.1
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * paper-styles#PolymerElements/paper-styles#^1.0.0 * polymer#Polymer/polymer#^1.1.0

paper-toast version 1.1.2
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * paper-styles#PolymerElements/paper-styles#^1.0.0 * polymer#Polymer/polymer#^1.1.0

paper-toast version 1.1.3
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * paper-styles#PolymerElements/paper-styles#^1.0.0 * polymer#Polymer/polymer#^1.1.0

paper-toast version 0.0.1
### Dependencies * @polymer/iron-a11y-announcer#^0.0.1 * @polymer/iron-overlay-behavior#^0.0.1 * @polymer/polymer#^1.2.5-npm-test.2

paper-toast version 0.0.3
### Dependencies * @polymer/iron-a11y-announcer#^0.0.3 * @polymer/iron-overlay-behavior#^0.0.3 * @polymer/polymer#^1.2.5-npm-test.2

paper-toast version 1.2.0
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * polymer#Polymer/polymer#^1.1.0

paper-toast version 1.2.1
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * polymer#Polymer/polymer#^1.1.0

paper-toast version 1.2.2
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * polymer#Polymer/polymer#^1.1.0

paper-toast version 1.3.0
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * iron-fit-behavior#PolymerElements/iron-fit-behavior#^1.1.0 * polymer#Polymer/polymer#^1.5.0

paper-toast version 1.3.1
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#^1.0.0 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#^1.0.9 * iron-fit-behavior#PolymerElements/iron-fit-behavior#^1.1.0 * polymer#Polymer/polymer#^1.5.0

paper-toast version 2.0.0
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#1 - 2 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#1 - 2 * iron-fit-behavior#PolymerElements/iron-fit-behavior#1 - 2 * polymer#Polymer/polymer#1.9 - 2

paper-toast version 3.0.0-pre.1
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.1 * @polymer/iron-overlay-behavior#^3.0.0-pre.1 * @polymer/iron-fit-behavior#^3.0.0-pre.1 * @polymer/polymer#^3.0.0-pre.1

paper-toast version 3.0.0-pre.2
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.1 * @polymer/iron-overlay-behavior#^3.0.0-pre.1 * @polymer/iron-fit-behavior#^3.0.0-pre.1 * @polymer/polymer#^3.0.0-pre.1

paper-toast version 3.0.0-pre.3
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.3 * @polymer/iron-overlay-behavior#^3.0.0-pre.3 * @polymer/iron-fit-behavior#^3.0.0-pre.3 * @polymer/polymer#^3.0.0-pre.3

paper-toast version 3.0.0-pre.4
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.4 * @polymer/iron-overlay-behavior#^3.0.0-pre.4 * @polymer/iron-fit-behavior#^3.0.0-pre.4 * @polymer/polymer#^3.0.0-pre.4

paper-toast version 3.0.0-pre.6
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.6 * @polymer/iron-overlay-behavior#^3.0.0-pre.6 * @polymer/iron-fit-behavior#^3.0.0-pre.6 * @polymer/polymer#^3.0.0-pre.6

paper-toast version 3.0.0-pre.7
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.7 * @polymer/iron-overlay-behavior#^3.0.0-pre.7 * @polymer/iron-fit-behavior#^3.0.0-pre.7 * @polymer/polymer#^3.0.0-pre.7

paper-toast version 3.0.0-pre.8
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.7 * @polymer/iron-overlay-behavior#^3.0.0-pre.7 * @polymer/iron-fit-behavior#^3.0.0-pre.7 * @polymer/polymer#^3.0.0-pre.7

paper-toast version 2.1.0
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#1 - 2 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#1 - 2 * iron-fit-behavior#PolymerElements/iron-fit-behavior#1 - 2 * polymer#Polymer/polymer#1.9 - 2

paper-toast version 3.0.0-pre.10
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.10 * @polymer/iron-overlay-behavior#^3.0.0-pre.10 * @polymer/iron-fit-behavior#^3.0.0-pre.10 * @polymer/polymer#^3.0.0-pre.10

paper-toast version 3.0.0-pre.11
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.10 * @polymer/iron-overlay-behavior#^3.0.0-pre.10 * @polymer/iron-fit-behavior#^3.0.0-pre.10 * @polymer/polymer#^3.0.0-pre.10

paper-toast version 3.0.0-pre.12
### Dependencies * @polymer/iron-a11y-announcer#3.0.0-pre.12 * @polymer/iron-overlay-behavior#3.0.0-pre.12 * @polymer/iron-fit-behavior#3.0.0-pre.12 * @polymer/polymer#3.0.0-pre.12

paper-toast version 2.1.1
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#1 - 2 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#1 - 2 * iron-fit-behavior#PolymerElements/iron-fit-behavior#1 - 2 * polymer#Polymer/polymer#1.9 - 2

paper-toast version 3.0.0-pre.13
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.13 * @polymer/iron-overlay-behavior#^3.0.0-pre.13 * @polymer/iron-fit-behavior#^3.0.0-pre.13 * @polymer/polymer#^3.0.0-pre.13

paper-toast version 3.0.0-pre.14
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.14 * @polymer/iron-overlay-behavior#^3.0.0-pre.14 * @polymer/iron-fit-behavior#^3.0.0-pre.14 * @polymer/polymer#^3.0.0-pre.13

paper-toast version 3.0.0-pre.15
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.15 * @polymer/iron-overlay-behavior#^3.0.0-pre.15 * @polymer/iron-fit-behavior#^3.0.0-pre.15 * @polymer/polymer#^3.0.0-pre.13

paper-toast version 3.0.0-pre.16
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.16 * @polymer/iron-overlay-behavior#^3.0.0-pre.16 * @polymer/iron-fit-behavior#^3.0.0-pre.16 * @polymer/polymer#^3.0.0-pre.13

paper-toast version 3.0.0-pre.17
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.17 * @polymer/iron-overlay-behavior#^3.0.0-pre.17 * @polymer/iron-fit-behavior#^3.0.0-pre.17 * @polymer/polymer#^3.0.0-pre.13

paper-toast version 3.0.0-pre.18
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.18 * @polymer/iron-overlay-behavior#^3.0.0-pre.18 * @polymer/iron-fit-behavior#^3.0.0-pre.18 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0-pre.19
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.19 * @polymer/iron-overlay-behavior#^3.0.0-pre.19 * @polymer/iron-fit-behavior#^3.0.0-pre.19 * @polymer/polymer#^3.0.0

paper-toast version 2.1.2
### Dependencies * iron-a11y-announcer#PolymerElements/iron-a11y-announcer#1 - 2 * iron-overlay-behavior#PolymerElements/iron-overlay-behavior#1 - 2 * iron-fit-behavior#PolymerElements/iron-fit-behavior#1 - 2 * polymer#Polymer/polymer#1.9 - 2

paper-toast version 3.0.0-pre.20
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.20 * @polymer/iron-overlay-behavior#^3.0.0-pre.20 * @polymer/iron-fit-behavior#^3.0.0-pre.20 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0-pre.21
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.21 * @polymer/iron-overlay-behavior#^3.0.0-pre.21 * @polymer/iron-fit-behavior#^3.0.0-pre.21 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0-pre.22
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.20 * @polymer/iron-overlay-behavior#^3.0.0-pre.20 * @polymer/iron-fit-behavior#^3.0.0-pre.20 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0-pre.23
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.22 * @polymer/iron-overlay-behavior#^3.0.0-pre.23 * @polymer/iron-fit-behavior#^3.0.0-pre.22 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0-pre.24
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.22 * @polymer/iron-overlay-behavior#^3.0.0-pre.23 * @polymer/iron-fit-behavior#^3.0.0-pre.22 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0-pre.25
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.24 * @polymer/iron-overlay-behavior#^3.0.0-pre.25 * @polymer/iron-fit-behavior#^3.0.0-pre.24 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0-pre.26
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.25 * @polymer/iron-overlay-behavior#^3.0.0-pre.26 * @polymer/iron-fit-behavior#^3.0.0-pre.25 * @polymer/polymer#^3.0.0

paper-toast version 3.0.0
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.26 * @polymer/iron-overlay-behavior#^3.0.0-pre.27 * @polymer/iron-fit-behavior#^3.0.0-pre.26 * @polymer/polymer#^3.0.0

paper-toast version 3.0.1
### Dependencies * @polymer/iron-a11y-announcer#^3.0.0-pre.26 * @polymer/iron-overlay-behavior#^3.0.0-pre.27 * @polymer/iron-fit-behavior#^3.0.0-pre.26 * @polymer/polymer#^3.0.0