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
210
211
212
213
214
215
216
217
218
<form data-controller="midwest-form" action="/products" accept-charset="UTF-8" method="post"><input type="hidden" name="authenticity_token" value="dYImpwjkotrGr_eYg4fG1R7iMtJoLE_Zdy9-FOGuBGKswmjm3anFERM38POD_SFqB0hn-tFW9sLETgiglJ0xDw" autocomplete="off" /> <div class="midwest-grid" style="--grid-width: 200px; --grid-gap: 2rem"> <div class="midwest-collection midwest-form-group "> <div class="midwest-form-group__top"> <label class="midwest-label " for="product_plan_id-12140"> Choose a plan </label> </div> <div class="midwest-grid" style="--grid-width: 100%; --grid-gap: 0.25rem"> <label class="midwest-card-option " for="product_plan_id-12148"> <input id="product_plan_id-12148" class="radio" aria-checked="false" type="radio" value="1" name="product[plan_id]" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Rocket outline"><title>Rocket outline</title> <path d="M461.81 53.81a4.4 4.4 0 00-3.3-3.39c-54.38-13.3-180 34.09-248.13 102.17a294.9 294.9 0 00-33.09 39.08c-21-1.9-42-.3-59.88 7.5-50.49 22.2-65.18 80.18-69.28 105.07a9 9 0 009.8 10.4l81.07-8.9a180.29 180.29 0 001.1 18.3 18.15 18.15 0 005.3 11.09l31.39 31.39a18.15 18.15 0 0011.1 5.3 179.91 179.91 0 0018.19 1.1l-8.89 81a9 9 0 0010.39 9.79c24.9-4 83-18.69 105.07-69.17 7.8-17.9 9.4-38.79 7.6-59.69a293.91 293.91 0 0039.19-33.09c68.38-68 115.47-190.86 102.37-247.95zM298.66 213.67a42.7 42.7 0 1160.38 0 42.65 42.65 0 01-60.38 0z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path d="M109.64 352a45.06 45.06 0 00-26.35 12.84C65.67 382.52 64 448 64 448s65.52-1.67 83.15-19.31A44.73 44.73 0 00160 402.32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Starter</strong> <span class="midwest-card-option__description">Everything you need to get off the ground</span> </div> </label> <label class="midwest-card-option " for="product_plan_id-12150"> <input id="product_plan_id-12150" class="radio" aria-checked="false" type="radio" value="2" name="product[plan_id]" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Flash outline"><title>Flash outline</title> <path d="M315.27 33L96 304h128l-31.51 173.23a2.36 2.36 0 002.33 2.77h0a2.36 2.36 0 001.89-.95L416 208H288l31.66-173.25a2.45 2.45 0 00-2.44-2.75h0a2.42 2.42 0 00-1.95 1z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Pro</strong> <span class="midwest-card-option__description">Advanced features for growing teams</span> </div> </label> <label class="midwest-card-option " for="product_plan_id-12158"> <input id="product_plan_id-12158" class="radio" aria-checked="false" type="radio" value="3" name="product[plan_id]" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Shield outline"><title>Shield outline</title> <path d="M463.1 112.37C373.68 96.33 336.71 84.45 256 48c-80.71 36.45-117.68 48.33-207.1 64.37C32.7 369.13 240.58 457.79 256 464c15.42-6.21 223.3-94.87 207.1-351.63z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Enterprise</strong> <span class="midwest-card-option__description">Full control, compliance, and dedicated support</span> </div> </label> </div> </div> <div class="midwest-collection midwest-form-group "> <div class="midwest-form-group__top"> <label class="midwest-label " for="product_related_product_ids-12160"> Add-ons </label> </div> <div class="midwest-grid" style="--grid-width: 100%; --grid-gap: 0.25rem"> <label class="midwest-card-option " for="product_related_product_ids-12168"> <input name="product[related_product_ids][]" type="hidden" value="0" autocomplete="off" /><input id="product_related_product_ids-12168" class="checkbox" name="product[related_product_ids][]" aria-checked="false" type="checkbox" value="1" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Rocket outline"><title>Rocket outline</title> <path d="M461.81 53.81a4.4 4.4 0 00-3.3-3.39c-54.38-13.3-180 34.09-248.13 102.17a294.9 294.9 0 00-33.09 39.08c-21-1.9-42-.3-59.88 7.5-50.49 22.2-65.18 80.18-69.28 105.07a9 9 0 009.8 10.4l81.07-8.9a180.29 180.29 0 001.1 18.3 18.15 18.15 0 005.3 11.09l31.39 31.39a18.15 18.15 0 0011.1 5.3 179.91 179.91 0 0018.19 1.1l-8.89 81a9 9 0 0010.39 9.79c24.9-4 83-18.69 105.07-69.17 7.8-17.9 9.4-38.79 7.6-59.69a293.91 293.91 0 0039.19-33.09c68.38-68 115.47-190.86 102.37-247.95zM298.66 213.67a42.7 42.7 0 1160.38 0 42.65 42.65 0 01-60.38 0z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path d="M109.64 352a45.06 45.06 0 00-26.35 12.84C65.67 382.52 64 448 64 448s65.52-1.67 83.15-19.31A44.73 44.73 0 00160 402.32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Starter</strong> <span class="midwest-card-option__description">Everything you need to get off the ground</span> </div> </label> <label class="midwest-card-option " for="product_related_product_ids-12178"> <input name="product[related_product_ids][]" type="hidden" value="0" autocomplete="off" /><input id="product_related_product_ids-12178" class="checkbox" name="product[related_product_ids][]" aria-checked="false" type="checkbox" value="2" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Flash outline"><title>Flash outline</title> <path d="M315.27 33L96 304h128l-31.51 173.23a2.36 2.36 0 002.33 2.77h0a2.36 2.36 0 001.89-.95L416 208H288l31.66-173.25a2.45 2.45 0 00-2.44-2.75h0a2.42 2.42 0 00-1.95 1z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Pro</strong> <span class="midwest-card-option__description">Advanced features for growing teams</span> </div> </label> <label class="midwest-card-option " for="product_related_product_ids-12180"> <input name="product[related_product_ids][]" type="hidden" value="0" autocomplete="off" /><input id="product_related_product_ids-12180" class="checkbox" name="product[related_product_ids][]" aria-checked="false" type="checkbox" value="3" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Shield outline"><title>Shield outline</title> <path d="M463.1 112.37C373.68 96.33 336.71 84.45 256 48c-80.71 36.45-117.68 48.33-207.1 64.37C32.7 369.13 240.58 457.79 256 464c15.42-6.21 223.3-94.87 207.1-351.63z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Enterprise</strong> <span class="midwest-card-option__description">Full control, compliance, and dedicated support</span> </div> </label> </div> </div> <div class="midwest-collection midwest-form-group "> <div class="midwest-form-group__top"> <label class="midwest-label " for="product_plan_id-12188"> Choose a plan (no icons) </label> </div> <div class="midwest-grid" style="--grid-width: 100%; --grid-gap: 0.25rem"> <label class="midwest-card-option " for="product_plan_id-12190"> <input id="product_plan_id-12190" class="radio" aria-checked="false" type="radio" value="1" name="product[plan_id]" /> <div class="midwest-card-option__body"> <strong class="midwest-card-option__title">Starter</strong> <span class="midwest-card-option__description">Everything you need to get off the ground</span> </div> </label> <label class="midwest-card-option " for="product_plan_id-12198"> <input id="product_plan_id-12198" class="radio" aria-checked="false" type="radio" value="2" name="product[plan_id]" /> <div class="midwest-card-option__body"> <strong class="midwest-card-option__title">Pro</strong> <span class="midwest-card-option__description">Advanced features for growing teams</span> </div> </label> <label class="midwest-card-option " for="product_plan_id-121a0"> <input id="product_plan_id-121a0" class="radio" aria-checked="false" type="radio" value="3" name="product[plan_id]" /> <div class="midwest-card-option__body"> <strong class="midwest-card-option__title">Enterprise</strong> <span class="midwest-card-option__description">Full control, compliance, and dedicated support</span> </div> </label> </div> </div> <div class="midwest-collection midwest-form-group "> <div class="midwest-form-group__top"> <label class="midwest-label " for="product_related_product_ids-121a8"> Add-ons (no descriptions) </label> </div> <div class="midwest-grid" style="--grid-width: 100%; --grid-gap: 0.25rem"> <label class="midwest-card-option " for="product_related_product_ids-121b0"> <input name="product[related_product_ids][]" type="hidden" value="0" autocomplete="off" /><input id="product_related_product_ids-121b0" class="checkbox" name="product[related_product_ids][]" aria-checked="false" type="checkbox" value="1" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Rocket outline"><title>Rocket outline</title> <path d="M461.81 53.81a4.4 4.4 0 00-3.3-3.39c-54.38-13.3-180 34.09-248.13 102.17a294.9 294.9 0 00-33.09 39.08c-21-1.9-42-.3-59.88 7.5-50.49 22.2-65.18 80.18-69.28 105.07a9 9 0 009.8 10.4l81.07-8.9a180.29 180.29 0 001.1 18.3 18.15 18.15 0 005.3 11.09l31.39 31.39a18.15 18.15 0 0011.1 5.3 179.91 179.91 0 0018.19 1.1l-8.89 81a9 9 0 0010.39 9.79c24.9-4 83-18.69 105.07-69.17 7.8-17.9 9.4-38.79 7.6-59.69a293.91 293.91 0 0039.19-33.09c68.38-68 115.47-190.86 102.37-247.95zM298.66 213.67a42.7 42.7 0 1160.38 0 42.65 42.65 0 01-60.38 0z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path><path d="M109.64 352a45.06 45.06 0 00-26.35 12.84C65.67 382.52 64 448 64 448s65.52-1.67 83.15-19.31A44.73 44.73 0 00160 402.32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Starter</strong> </div> </label> <label class="midwest-card-option " for="product_related_product_ids-121b8"> <input name="product[related_product_ids][]" type="hidden" value="0" autocomplete="off" /><input id="product_related_product_ids-121b8" class="checkbox" name="product[related_product_ids][]" aria-checked="false" type="checkbox" value="2" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Flash outline"><title>Flash outline</title> <path d="M315.27 33L96 304h128l-31.51 173.23a2.36 2.36 0 002.33 2.77h0a2.36 2.36 0 001.89-.95L416 208H288l31.66-173.25a2.45 2.45 0 00-2.44-2.75h0a2.42 2.42 0 00-1.95 1z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Pro</strong> </div> </label> <label class="midwest-card-option " for="product_related_product_ids-121c8"> <input name="product[related_product_ids][]" type="hidden" value="0" autocomplete="off" /><input id="product_related_product_ids-121c8" class="checkbox" name="product[related_product_ids][]" aria-checked="false" type="checkbox" value="3" /> <div class="midwest-card-option__body"> <div class="midwest-card-option__icon"> <div class="midwest-icon "> <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="Shield outline"><title>Shield outline</title> <path d="M463.1 112.37C373.68 96.33 336.71 84.45 256 48c-80.71 36.45-117.68 48.33-207.1 64.37C32.7 369.13 240.58 457.79 256 464c15.42-6.21 223.3-94.87 207.1-351.63z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path></svg> </div> </div> </div> <strong class="midwest-card-option__title">Enterprise</strong> </div> </label> </div> </div> </div> <div class="midwest-grid" style="--grid-width: 200px; --grid-gap: 2rem"> <button type="submit" class="midwest-button variant-default size-default theme-primary" name="product_submit"> <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> </div></form>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<%= midwest_form_with(model: product) do |form| %> <%= midwest_grid do %> <%= form.collection_icon_radio_buttons :plan_id, products, :id, :title, :icon, :description, label: "Choose a plan" %> <%= form.collection_icon_check_boxes :related_product_ids, products, :id, :title, :icon, :description, label: "Add-ons" %> <%# Without icons — title and description only %> <%= form.collection_icon_radio_buttons :plan_id, products, :id, :title, nil, :description, label: "Choose a plan (no icons)" %> <%# Without descriptions — icon and title only %> <%= form.collection_icon_check_boxes :related_product_ids, products, :id, :title, :icon, nil, label: "Add-ons (no descriptions)" %> <% end %> <%= midwest_grid do %> <%= form.submit %> <% end %><% end %>Icon Cards
Use collectioniconradiobuttons and collectioniconcheckboxes to render each option as a rounded card with an icon, title, and description. The hidden input toggles the card between an inactive gray state and an active themed state with a thicker border.
No params configured.
No assets to display.
Add a .js or .css file alongside the component to see it here.
Figma embed for Form Builder/icon_cards
Annotate a preview to embed its Figma design here:
@figma "https://figma.com/..."