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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<form action="#" onsubmit="return false"> <div role="region" aria-label="Carousel" style="--carousel-gap: 0rem" data-controller="midwest-carousel" data-midwest-carousel-wizard-value="true" class="midwest-carousel"> <div class="midwest-carousel-viewport"> <div class="midwest-carousel-track" data-midwest-carousel-target="track" data-action="scroll->midwest-carousel#scrolled scrollend->midwest-carousel#scrolled"> <div class="midwest-slide" style="--slide-width: 100%"> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <header> <h4>Step 1 — Personal Info</h4> </header> <section> <div class="midwest-grid" style="--grid-width: 200px; --grid-gap: 1rem"> <div class="midwest-input midwest-form-group type-text" data-controller="midwest-input"> <div class="midwest-form-group__top"> <label class="midwest-label " for="first_name-e600"> First name </label> </div> <input type="text" name="first_name" id="first_name-e600" autocomplete="given-name" placeholder="Jane" data-midwest-input-target="input" /> </div> <div class="midwest-input midwest-form-group type-text" data-controller="midwest-input"> <div class="midwest-form-group__top"> <label class="midwest-label " for="last_name-e608"> Last name </label> </div> <input type="text" name="last_name" id="last_name-e608" autocomplete="family-name" placeholder="Smith" data-midwest-input-target="input" /> </div> </div> </section> <footer> <button data-action="click->midwest-carousel#unlockNext" class="midwest-button variant-default size-default theme-primary" name="button"> <span class="midwest-button-content">Continue</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> </footer> </div> </article> </div> <div class="midwest-slide" style="--slide-width: 100%"> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <header> <h4>Step 2 — Contact</h4> </header> <section> <div class="midwest-grid" style="--grid-width: 200px; --grid-gap: 1rem"> <div class="midwest-input midwest-form-group type-email" data-controller="midwest-input"> <div class="midwest-form-group__top"> <label class="midwest-label " for="email-e610"> Email </label> </div> <input type="email" name="email" id="email-e610" autocomplete="email" placeholder="jane@example.com" data-midwest-input-target="input" /> </div> <div class="midwest-input midwest-form-group type-tel" data-controller="midwest-input"> <div class="midwest-form-group__top"> <label class="midwest-label " for="phone-e618"> Phone </label> </div> <input type="tel" name="phone" id="phone-e618" autocomplete="tel" placeholder="+1 (555) 000-0000" data-midwest-input-target="input" /> </div> </div> </section> <footer> <button data-action="click->midwest-carousel#unlockNext" class="midwest-button variant-default size-default theme-primary" name="button"> <span class="midwest-button-content">Continue</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> </footer> </div> </article> </div> <div class="midwest-slide" style="--slide-width: 100%"> <article data-controller="midwest-card" class="midwest-card"> <div class="wrap"> <header> <h4>Step 3 — Review & Submit</h4> </header> <section> <div data-controller="midwest-form-live-summary" class="midwest-form-live-summary"> <div data-midwest-form-live-summary-target="list" aria-live="polite"></div> </div> </section> <footer> <button type="submit" class="midwest-button variant-default size-default theme-primary" name="button"> <span class="midwest-button-content">Submit</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> </footer> </div> </article> </div> </div> <button type="button" class="midwest-carousel-nav prev hide" aria-label="Previous slide" data-action="click->midwest-carousel#previous" data-midwest-carousel-target="prev" disabled> <div class="midwest-icon " aria-hidden="true"> <div class="midwest-icon-inner"> <svg xmlns="http://www.w3.org/2000/svg" class="Midwest-Icon__Svg" viewbox="0 0 512 512" focusable="false" role="img" aria-label="Chevron back"><title>Chevron back</title> <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M328 112L184 256l144 144"></path></svg> </div> </div> </button> <button type="button" class="midwest-carousel-nav next hide" aria-label="Next slide" data-action="click->midwest-carousel#next" data-midwest-carousel-target="next"> <div class="midwest-icon " aria-hidden="true"> <div class="midwest-icon-inner"> <svg xmlns="http://www.w3.org/2000/svg" class="Midwest-Icon__Svg" viewbox="0 0 512 512" focusable="false" role="img" aria-label="Chevron forward"><title>Chevron forward</title> <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M184 112l144 144-144 144"></path></svg> </div> </div> </button> </div> <div class="midwest-carousel-pager"> <button type="button" class="midwest-carousel-pager-dot" aria-label="Go to slide 1" data-action="click->midwest-carousel#goto" data-index="0" data-midwest-carousel-target="dot"> 1 </button> <button type="button" class="midwest-carousel-pager-dot" aria-label="Go to slide 2" data-action="click->midwest-carousel#goto" data-index="1" data-midwest-carousel-target="dot"> 2 </button> <button type="button" class="midwest-carousel-pager-dot" aria-label="Go to slide 3" data-action="click->midwest-carousel#goto" data-index="2" data-midwest-carousel-target="dot"> 3 </button> </div> <p class="sr-only" aria-live="polite" aria-atomic="true" data-midwest-carousel-target="status"></p> </div></form>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
<form action="#" onsubmit="return false"> <%= midwest_carousel(wizard: true, pager: true) do |c| %> <% c.with_slide do %> <%= midwest_card do |card| %> <% card.with_header do %><h4>Step 1 — Personal Info</h4><% end %> <% card.with_section do %> <%= midwest_grid(gap: 1) do %> <%= midwest_form_input(name: "first_name", label: "First name", placeholder: "Jane", autocomplete: "given-name") %> <%= midwest_form_input(name: "last_name", label: "Last name", placeholder: "Smith", autocomplete: "family-name") %> <% end %> <% end %> <% card.with_footer do %> <%= midwest_button("Continue", as: :button, "data-action": "click->midwest-carousel#unlockNext") %> <% end %> <% end %> <% end %> <% c.with_slide do %> <%= midwest_card do |card| %> <% card.with_header do %><h4>Step 2 — Contact</h4><% end %> <% card.with_section do %> <%= midwest_grid(gap: 1) do %> <%= midwest_form_input(name: "email", label: "Email", type: :email, placeholder: "jane@example.com", autocomplete: "email") %> <%= midwest_form_input(name: "phone", label: "Phone", type: :tel, placeholder: "+1 (555) 000-0000", autocomplete: "tel") %> <% end %> <% end %> <% card.with_footer do %> <%= midwest_button("Continue", as: :button, "data-action": "click->midwest-carousel#unlockNext") %> <% end %> <% end %> <% end %> <% c.with_slide do %> <%= midwest_card do |card| %> <% card.with_header do %><h4>Step 3 — Review & Submit</h4><% end %> <% card.with_section do %> <%= midwest_form_live_summary %> <% end %> <% card.with_footer do %> <%= midwest_button("Submit", as: :submit) %> <% end %> <% end %> <% end %> <% end %></form>Wizard
Linear step-by-step mode. Navigation is locked until the user explicitly
advances via an unlockNext action inside each slide. Useful for
multi-step forms where all slide inputs must be accessible to a single
enclosing <form>.
No params configured.
No assets to display.
Add a .js or .css file alongside the component to see it here.
Figma embed for Carousel/wizard
Annotate a preview to embed its Figma design here:
@figma "https://figma.com/..."