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
<div class="p-8 space-y-6">
<h2 class="text-2xl font-bold mb-6">Dismissible Messages</h2>
<p class="text-grayscale-600 mb-4">Click the X button to dismiss each message.</p>
<div class="space-y-4">
<div data-controller="better-ui--action-messages" class="rounded-lg p-4 relative bg-info-50 border border-info-200 text-info-900">
<div class="font-semibold mb-2 text-info-900">
Info Message
</div>
<div class="flex gap-3">
<ul class="list-none list-inside space-y-1 flex-1">
<li class="text-sm">This is a dismissible info message.</li>
<li class="text-sm">Click the X button to close it and see the fade-out animation.</li>
</ul>
</div>
<button type="button"
data-action="click->better-ui--action-messages#dismiss"
class="absolute top-3 right-3 p-1 rounded transition-colors text-info-700 hover:bg-info-100"
aria-label="Dismiss">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
<div data-controller="better-ui--action-messages" class="rounded-lg p-4 relative bg-warning-50 border border-warning-200 text-warning-900">
<div class="font-semibold mb-2 text-warning-900">
Warning Message
</div>
<div class="flex gap-3">
<ul class="list-none list-inside space-y-1 flex-1">
<li class="text-sm">This is a dismissible warning message.</li>
<li class="text-sm">Click the X button to close it and see the fade-out animation.</li>
</ul>
</div>
<button type="button"
data-action="click->better-ui--action-messages#dismiss"
class="absolute top-3 right-3 p-1 rounded transition-colors text-warning-700 hover:bg-warning-100"
aria-label="Dismiss">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
<div data-controller="better-ui--action-messages" class="rounded-lg p-4 relative bg-danger-50 border border-danger-200 text-danger-900">
<div class="font-semibold mb-2 text-danger-900">
Danger Message
</div>
<div class="flex gap-3">
<ul class="list-none list-inside space-y-1 flex-1">
<li class="text-sm">This is a dismissible danger message.</li>
<li class="text-sm">Click the X button to close it and see the fade-out animation.</li>
</ul>
</div>
<button type="button"
data-action="click->better-ui--action-messages#dismiss"
class="absolute top-3 right-3 p-1 rounded transition-colors text-danger-700 hover:bg-danger-100"
aria-label="Dismiss">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</div>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<div class="p-8 space-y-6">
<h2 class="text-2xl font-bold mb-6">Dismissible Messages</h2>
<p class="text-grayscale-600 mb-4">Click the X button to dismiss each message.</p>
<div class="space-y-4">
<% (@variants || [:info, :warning, :danger]).each do |variant| %>
<%= render BetterUi::ActionMessagesComponent.new(
variant: variant,
style: :soft,
dismissible: true,
title: "#{variant.to_s.capitalize} Message",
messages: [
"This is a dismissible #{variant} message.",
"Click the X button to close it and see the fade-out animation."
]
) %>
<% end %>
</div>
</div>