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
<div class="flex items-center justify-center p-16"> <div id="confirmation-136b8" popover="auto" class="midwest-popover anchored midwest-confirmation" style="position-anchor: --confirmation-136b8-button; anchor-name: --confirmation-136b8" data-controller="midwest-confirmation" data-midwest-confirmation-confirm-text-value="delete my workspace"> <article data-controller="midwest-card" class="midwest-card min-w-[20rem]"> <div class="wrap"> <header> <h4>Delete workspace</h4> </header> <section> <p class="w-full text-wrap">This will permanently delete your workspace and all associated data. This action cannot be undone.</p> <div class="confirmation-type-field"> <label class="block text-sm mb-1"> Type <strong>delete my workspace</strong> to confirm: </label> <input type="text" placeholder="delete my workspace" class="confirmation-type-input w-full" data-midwest-confirmation-target="input" data-action="input->midwest-confirmation#validate" autocomplete="off" aria-label="Type delete my workspace to confirm"> </div> </section> <footer> <button popovertarget="confirmation-136b8" type="button" autofocus="autofocus" class="midwest-button variant-outline size-default theme-primary" name="button" value="false"> <span class="midwest-button-content"><span class="translation_missing" title="translation missing: en.midwest.confirmation_component.no, locale: en">No</span></span> <div class="midwest-loading-icon" role="img" aria-label="Loading" aria-hidden="true" style="display: none"> <div class="midwest-loading-icon-inner"> <!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL --> <svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true"> <circle cx="15" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="60" cy="15" r="9" fill-opacity="0.3"> <animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="105" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> </svg> </div> </div> </button> <a type="button" data-midwest-confirmation-target="submitButton" aria-disabled="true" tabindex="-1" path="#" class="midwest-button variant-primary size-default disabled theme-red" name="button" disabled="disabled" rel="nofollow" data-method="delete" href="#"> <span class="midwest-button-content"><span class="translation_missing" title="translation missing: en.midwest.confirmation_component.yes, locale: en">Yes</span></span> <div class="midwest-loading-icon" role="img" aria-label="Loading" aria-hidden="true" style="display: none"> <div class="midwest-loading-icon-inner"> <!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL --> <svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true"> <circle cx="15" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="60" cy="15" r="9" fill-opacity="0.3"> <animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="105" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> </svg> </div> </div> </a> </footer> </div> </article> </div> <button popovertarget="confirmation-136b8" style="anchor-name: --confirmation-136b8-button;" class="midwest-button variant-outline size-default theme-red" name="button"> <span class="midwest-button-content">Delete workspace</span> <div class="midwest-loading-icon" role="img" aria-label="Loading" aria-hidden="true" style="display: none"> <div class="midwest-loading-icon-inner"> <!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL --> <svg viewbox="0 0 120 30" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="Midwest-LoadingIcon__Svg" focusable="false" aria-hidden="true"> <circle cx="15" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="60" cy="15" r="9" fill-opacity="0.3"> <animate attributename="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcmode="linear" repeatcount="indefinite"></animate> </circle> <circle cx="105" cy="15" r="15"> <animate attributename="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcmode="linear" repeatcount="indefinite"></animate> <animate attributename="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcmode="linear" repeatcount="indefinite"></animate> </circle> </svg> </div> </div> </button></div>1
2
3
4
5
6
7
8
9
10
11
<div class="flex items-center justify-center p-16"> <%= render Midwest::ConfirmationComponent.new( title: 'Delete workspace', text: 'This will permanently delete your workspace and all associated data. This action cannot be undone.', confirm_phrase: 'delete my workspace', destructive: true, action_args: { path: '#', method: :delete } ) do |c| %> <%= midwest_button('Delete workspace', as: :button, variant: :outline, state: :error, **c.confirm_attrs) %> <% end %></div>Destructive
For irreversible actions, require the user to type a phrase before the confirm button becomes active. The button starts disabled and only enables once the input matches exactly.
No params configured.
No assets to display.
Add a .js or .css file alongside the component to see it here.
Figma embed for Confirmation/destructive
Annotate a preview to embed its Figma design here:
@figma "https://figma.com/..."