-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathtoast.html.erb
More file actions
38 lines (29 loc) · 1.37 KB
/
toast.html.erb
File metadata and controls
38 lines (29 loc) · 1.37 KB
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
<%= render_component_header title: "Toast",
description: "A succinct message that is displayed temporarily." %>
<% content_for :preview, flush: true do %>
<div class="w-full flex justify-center">
<%= render_button "Trigger Toast", variant: "outline", data: {controller: "ui--toast", action: "ui--toast#trigger", target: "#default_toast"} %>
<%= render_code_preview('toast') %>
</div>
<% end %>
<% content_for :code, flush: true do %>
<%= code_partial("toast/preview", :erb) %>
<% end %>
<%= render_preview %>
<h2 class="font-heading scroll-m-20 border-b pb-2 text-2xl font-semibold tracking-tight first:mt-0" id="installation">Installation</h2>
<%= code_sample(language: "sh") do %>
rails generate shadcn-ui toast
<% end %>
<h2 class="font-heading mt-12 scroll-m-20 border-b pb-2 mb-2 text-2xl font-semibold tracking-tight first:mt-0" id="usage">Usage</h2>
<%= code_partial("toast/usage", :erb) %>
<%= render_usage("toast") %>
<% content_for :examples, flush: true do %>
<div class="w-full flex justify-center">
<%= render_button "Trigger Destructive Toast", variant: "outline", data: {controller: "ui--toast", action: "ui--toast#trigger", target: "#alert_toast"} %>
<%= render "examples/components/toast/code/destructive" %>
</div>
<% end %>
<% content_for :code, flush: true do %>
<%= code_partial("toast/destructive", :erb) %>
<% end %>
<%= render_example %>