Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<div data-controller="polaris-frame" class="Polaris-Frame">
<div data-polaris-frame-target="navigationOverlay"></div>
<main class="Polaris-Frame__Main">
<div class="Polaris-Frame__Content">
<div class="Polaris-Page">
<div style="--pc-box-border-color: transparent;--pc-box-border-style: solid;--pc-box-padding-block-end-xs: var(--p-space-4);--pc-box-padding-block-end-md: var(--p-space-5);--pc-box-padding-block-start-xs: var(--p-space-4);--pc-box-padding-block-start-md: var(--p-space-5);--pc-box-padding-inline-end-xs: var(--p-space-4);--pc-box-padding-inline-end-sm: var(--p-space-0);--pc-box-padding-inline-start-xs: var(--p-space-4);--pc-box-padding-inline-start-sm: var(--p-space-0);position: relative" class="Polaris-Box">
<div class="Polaris-Page-Header--mobileView Polaris-Page-Header--mediumTitle Polaris-Page-Header--noBreadcrumbs">
<div class="Polaris-Page-Header__Row">
<div class="Polaris-Page-Header__TitleWrapper">
<div class="Polaris-Header-Title__TitleAndSubtitleWrapper">
<h1 class="Polaris-Header-Title">Toast example</h1>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div data-buttongroup-segmented="true" class="Polaris-ButtonGroup Polaris-ButtonGroup--segmented">
<div class="Polaris-ButtonGroup__Item"><button data-controller="polaris-button polaris" data-target="#demo-toast1" data-action="polaris#showToast" type="button" class="Polaris-Button">
<span class="Polaris-Button__Content">
<div class="Polaris-Button__Text">
Show toast 1
</div>
</span>
</button></div>
<div class="Polaris-ButtonGroup__Item"><button data-controller="polaris-button polaris" data-target="#demo-toast2" data-action="polaris#showToast" type="button" class="Polaris-Button">
<span class="Polaris-Button__Content">
<div class="Polaris-Button__Text">
Show toast 2
</div>
</span>
</button></div>
<div class="Polaris-ButtonGroup__Item"><button data-controller="polaris-button polaris" data-target="#demo-toast3" data-action="polaris#showToast" type="button" class="Polaris-Button">
<span class="Polaris-Button__Content">
<div class="Polaris-Button__Text">
Show toast 3
</div>
</span>
</button></div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="Polaris-Frame-ToastManager">
<div id="demo-toast1" data-controller="polaris-toast" data-polaris-toast-hidden-value="true" data-polaris-toast-has-action-value="false" class="Polaris-Frame-ToastManager__ToastWrapper">
<div>
<div class="Polaris-Frame-Toast">
Message sent
<button
data-action="polaris-toast#close"
type="button"
class="Polaris-Frame-Toast__CloseButton"
>
<span class="Polaris-Icon">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 20 20" class="Polaris-Icon__Svg" focusable="false" aria-hidden="true"><path d="M12.72 13.78a.75.75 0 1 0 1.06-1.06l-2.72-2.72 2.72-2.72a.75.75 0 0 0-1.06-1.06l-2.72 2.72-2.72-2.72a.75.75 0 0 0-1.06 1.06l2.72 2.72-2.72 2.72a.75.75 0 1 0 1.06 1.06l2.72-2.72 2.72 2.72Z"></path></svg>
</span>
</button>
</div>
</div>
</div>
<div id="demo-toast2" data-controller="polaris-toast" data-polaris-toast-hidden-value="true" data-polaris-toast-has-action-value="false" class="Polaris-Frame-ToastManager__ToastWrapper">
<div>
<div class="Polaris-Frame-Toast">
Image uploaded
<button
data-action="polaris-toast#close"
type="button"
class="Polaris-Frame-Toast__CloseButton"
>
<span class="Polaris-Icon">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 20 20" class="Polaris-Icon__Svg" focusable="false" aria-hidden="true"><path d="M12.72 13.78a.75.75 0 1 0 1.06-1.06l-2.72-2.72 2.72-2.72a.75.75 0 0 0-1.06-1.06l-2.72 2.72-2.72-2.72a.75.75 0 0 0-1.06 1.06l2.72 2.72-2.72 2.72a.75.75 0 1 0 1.06 1.06l2.72-2.72 2.72 2.72Z"></path></svg>
</span>
</button>
</div>
</div>
</div>
<div id="demo-toast3" data-controller="polaris-toast" data-polaris-toast-hidden-value="true" data-polaris-toast-has-action-value="false" class="Polaris-Frame-ToastManager__ToastWrapper">
<div>
<div class="Polaris-Frame-Toast">
Third toast
<button
data-action="polaris-toast#close"
type="button"
class="Polaris-Frame-Toast__CloseButton"
>
<span class="Polaris-Icon">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 20 20" class="Polaris-Icon__Svg" focusable="false" aria-hidden="true"><path d="M12.72 13.78a.75.75 0 1 0 1.06-1.06l-2.72-2.72 2.72-2.72a.75.75 0 0 0-1.06-1.06l-2.72 2.72-2.72-2.72a.75.75 0 0 0-1.06 1.06l2.72 2.72-2.72 2.72a.75.75 0 1 0 1.06 1.06l2.72-2.72 2.72 2.72Z"></path></svg>
</span>
</button>
</div>
</div>
</div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<%= polaris_frame do |frame| %>
<%= polaris_page(title: "Toast example") do %>
<%= polaris_button_group(segmented: true) do |group| %>
<% 3.times do |i| %>
<%= group.with_button(data: {
controller: "polaris",
target: "#demo-toast#{i + 1}",
action: "polaris#showToast",
}) { "Show toast #{i + 1}" } %>
<% end %>
<% end %>
<% end %>
<% frame.with_toasts do %>
<%= polaris_toast(id: "demo-toast1", hidden: true) { "Message sent" } %>
<%= polaris_toast(id: "demo-toast2", hidden: true) { "Image uploaded" } %>
<%= polaris_toast(id: "demo-toast3", hidden: true) { "Third toast" } %>
<% end %>
<% end %>