• Home
Name Date Size #Lines LOC

..--

.github/03-May-2024-3414

demo/03-May-2024-9770

test/03-May-2024-276213

.bower.jsonD03-May-20241.4 KiB4545

.gitignoreD03-May-202417 21

.travis.ymlD03-May-2024784 2524

CONTRIBUTING.mdD03-May-20243.4 KiB7839

README.mdD03-May-20241.9 KiB7336

bower.jsonD03-May-20241.1 KiB3635

hero.svgD03-May-2024805 2119

index.htmlD03-May-2024867 2712

paper-toast.htmlD03-May-20249.4 KiB324235

README.md

1
2<!---
3
4This README is automatically generated from the comments in these files:
5paper-toast.html
6
7Edit those files, and our readme bot will duplicate them over here!
8Edit this file, and the bot will squash your changes :)
9
10The bot does some handling of markdown. Please file a bug if it does the wrong
11thing! https://github.com/PolymerLabs/tedium/issues
12
13-->
14
15[![Build status](https://travis-ci.org/PolymerElements/paper-toast.svg?branch=master)](https://travis-ci.org/PolymerElements/paper-toast)
16
17_[Demo and API docs](https://elements.polymer-project.org/elements/paper-toast)_
18
19
20##&lt;paper-toast&gt;
21
22Material design: [Snackbars & toasts](https://www.google.com/design/spec/components/snackbars-toasts.html)
23
24`paper-toast` provides a subtle notification toast. Only one `paper-toast` will
25be visible on screen.
26
27Use `opened` to show the toast:
28
29Example:
30
31```html
32<paper-toast text="Hello world!" opened></paper-toast>
33```
34
35Also `open()` or `show()` can be used to show the toast:
36
37Example:
38
39```html
40<paper-button on-click="openToast">Open Toast</paper-button>
41<paper-toast id="toast" text="Hello world!"></paper-toast>
42
43...
44
45openToast: function() {
46  this.$.toast.open();
47}
48```
49
50Set `duration` to 0, a negative number or Infinity to persist the toast on screen:
51
52Example:
53
54```html
55<paper-toast text="Terms and conditions" opened duration="0">
56  <a href="#">Show more</a>
57</paper-toast>
58```
59
60### Styling
61
62The following custom properties and mixins are available for styling:
63
64| Custom property | Description | Default |
65| --- | --- | --- |
66| `--paper-toast-background-color` | The paper-toast background-color | `#323232` |
67| `--paper-toast-color` | The paper-toast color | `#f1f1f1` |
68
69This element applies the mixin `--paper-font-common-base` but does not import `paper-styles/typography.html`.
70In order to apply the `Roboto` font to this element, make sure you've imported `paper-styles/typography.html`.
71
72
73