4
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
Code distributed by Google as part of the polymer project is also
9
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
14
<title>paper-toast</title>
16
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
17
<meta name="mobile-web-app-capable" content="yes">
18
<meta name="apple-mobile-web-app-capable" content="yes">
20
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
22
<link rel="import" href="../paper-toast.html">
23
<link rel="import" href="../../paper-button/paper-button.html">
24
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
25
<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
27
<style is="custom-style" include="demo-pages-shared-styles"></style>
31
<body unresolved class="centered">
32
<h3>Toast auto-closes after 3 seconds. Only one toast per time will be visible</h3>
33
<demo-snippet class="centered-demo">
35
<paper-button raised onclick="toast0.open()">Default toast</paper-button>
36
<paper-toast id="toast0" text="This toast auto-closes after 3 seconds"></paper-toast>
40
<h3>Toast does not auto-close when <code>duration</code> is negative, <code>0</code>, or <code>Infinity</code></h3>
41
<demo-snippet class="centered-demo">
50
<paper-button raised onclick="toast1.open()">Persistent toast</paper-button>
52
<paper-toast id="toast1" duration="0" text="This toast will stay opened until you close it, or open another toast.">
53
<paper-button onclick="toast1.toggle()" class="yellow-button">Close now!</paper-button>
58
<h3>Toast can be styled</h3>
59
<demo-snippet class="centered-demo">
61
<style is="custom-style">
63
--paper-toast-background-color: red;
64
--paper-toast-color: white;
68
<paper-button raised onclick="toast2.open()">Styled toast</paper-button>
70
<paper-toast id="toast2" class="fit-bottom" text="This toast is red and fits bottom!"></paper-toast>
74
<h3>Toast can fit into any element</h3>
75
<demo-snippet class="centered-demo">
80
border: 1px solid gray;
84
<paper-button raised onclick="toast3.open()">Open toast</paper-button>
86
<paper-toast id="toast3" class="fit-bottom" text="This toast fits into the container."></paper-toast>
89
toast3.fitInto = container;