Mechanical rename of base::debug -> base::trace_event [final pass]
[chromium-blink-merge.git] / third_party / polymer / components-chromium / paper-toast / paper-toast.html
blobcf681a3ade0401523480589ae381527f3e7110b0
1 <!--
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 --><!--
9 `paper-toast` provides lightweight feedback about an operation in a small popup
10 at the base of the screen on mobile and at the lower left on desktop. Toasts are
11 above all other elements on screen, including the FAB.
13 Toasts automatically disappear after a timeout or after user interaction
14 elsewhere on the screen, whichever comes first. Toasts can be swiped off
15 screen. There can be only one on the screen at a time.
17 Example:
19 <paper-toast text="Your draft has been discarded." onclick="discardDraft(el)"></paper-toast>
21 <script>
22 function discardDraft(el) {
23 el.show();
25 </script>
27 An action button can be presented in the toast.
29 Example (using Polymer's data-binding features):
31 <paper-toast id="toast2" text="Connection timed out. Showing limited messages.">
32 <div style="color: blue;" on-tap="{{retry}}">Retry</div>
33 </paper-toast>
35 Positioning toast:
37 A standard toast appears near the lower left of the screen. You can change the
38 position by overriding bottom and left positions.
40 paper-toast {
41 bottom: 40px;
42 left: 10px;
45 To position the toast to the right:
47 paper-toast {
48 right: 10px;
49 left: auto;
52 To make it fit at the bottom of the screen:
54 paper-toast {
55 bottom: 0;
56 left: 0;
57 width: 100%;
60 When the screen size is smaller than the `responsiveWidth` (default to 480px),
61 the toast will automatically fits at the bottom of the screen.
63 @group Paper Elements
64 @element paper-toast
65 @homepage github.io
66 --><!--
67 Fired when the `paper-toast`'s `opened` property changes.
69 @event core-overlay-open
70 @param {boolean} detail the opened state
71 --><!--
72 Fired when the `paper-toast` has completely opened.
74 @event core-overlay-open-completed
75 --><!--
76 Fired when the `paper-toast` has completely closed.
78 @event core-overlay-close-completed
79 --><html><head><link rel="import" href="../core-overlay/core-overlay.html">
80 <link rel="import" href="../core-transition/core-transition-css.html">
81 <link rel="import" href="../core-media-query/core-media-query.html">
83 </head><body><polymer-element name="paper-toast" attributes="text duration opened responsiveWidth swipeDisabled autoCloseDisabled" role="status" assetpath="">
85 <template>
87 <link rel="stylesheet" href="paper-toast.css">
89 <core-overlay id="overlay" autofocusdisabled="" autoclosedisabled="{{autoCloseDisabled}}" opened="{{opened}}" target="{{}}" transition="core-transition-bottom"></core-overlay>
91 <div class="toast-container" horizontal="" layout="">
93 <div class="toast-text" flex="">{{text}}</div>
95 <div class="toast-text toast-action" on-tap="{{dismiss}}">
96 <content></content>
97 </div>
99 </div>
101 <core-media-query query="max-width: {{responsiveWidth}}" querymatches="{{narrowMode}}"></core-media-query>
103 </template>
105 </polymer-element>
106 <script src="paper-toast-extracted.js"></script></body></html>