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
<div class="p-8 max-w-sm"> <div data-controller="midwest-date-picker" data-midwest-date-picker-month-value="2026-09-01" data-placeholder="Select a date" class="midwest-date-picker midwest-form-group"> <button type="button" icon_size="sm" style="anchor-name: --date-picker-f238-trigger;" aria-label="" aria-expanded="false" data-action="midwest-date-picker#toggle" data-midwest-date-picker-target="trigger" class="midwest-button variant-outline size-default theme-primary date-picker-trigger" name="button"> <span class="midwest-button-content"> <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" aria-hidden="true"><rect fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" x="48" y="80" width="416" height="384" rx="48"></rect><circle cx="296" cy="232" r="24"></circle><circle cx="376" cy="232" r="24"></circle><circle cx="296" cy="312" r="24"></circle><circle cx="376" cy="312" r="24"></circle><circle cx="136" cy="312" r="24"></circle><circle cx="216" cy="312" r="24"></circle><circle cx="136" cy="392" r="24"></circle><circle cx="216" cy="392" r="24"></circle><circle cx="296" cy="392" r="24"></circle><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" stroke-linecap="round" d="M128 48v32M384 48v32"></path><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="32" d="M464 160H48"></path></svg> </div> </div> <span data-midwest-date-picker-target="display" class="midwest-badge size-default theme-primary"> <span class="value">Select a date</span> <input type="hidden" id="playground_date-f238" name="playground_date" tabindex="-1" data-midwest-date-picker-target="input"> </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> <div id="date-picker-f238" popover="auto" class="midwest-popover anchored" style="position-anchor: --date-picker-f238-trigger; anchor-name: --date-picker-f238" data-controller="midwest-popover" data-midwest-date-picker-target="popover"> <article role="dialog" aria-modal="true" aria-label="" data-controller="midwest-card" class="midwest-card date-picker-popover"> <div class="wrap"> <header class="date-picker-header"> <button type="button" aria-label="Previous month" data-action="midwest-date-picker#prevMonth" class="midwest-button variant-ghost size-small theme-primary" name="button"> <span class="midwest-button-content"> <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" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M328 112L184 256l144 144"></path></svg> </div> </div> </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> <span id="playground_date-f238-month-label" class="date-picker-month-label" aria-live="polite" data-midwest-date-picker-target="monthLabel"> September 2026 </span> <button type="button" aria-label="Next month" data-action="midwest-date-picker#nextMonth" class="midwest-button variant-ghost size-small theme-primary" name="button"> <span class="midwest-button-content"> <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" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="48" d="M184 112l144 144-144 144"></path></svg> </div> </div> </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> </header> <section> <table class="date-picker-calendar" role="grid" aria-labelledby="playground_date-f238-month-label"> <thead> <tr> <th scope="col" abbr="Sunday">Su</th> <th scope="col" abbr="Monday">Mo</th> <th scope="col" abbr="Tuesday">Tu</th> <th scope="col" abbr="Wednesday">We</th> <th scope="col" abbr="Thursday">Th</th> <th scope="col" abbr="Friday">Fr</th> <th scope="col" abbr="Saturday">Sa</th> </tr> </thead> <tbody data-midwest-date-picker-target="grid"> <tr> <td role="gridcell"><button type="button" class="date-picker-day is-outside" tabindex="-1" data-date="2026-08-30" data-action="midwest-date-picker#selectDate" aria-label="August 30, 2026">30</button></td> <td role="gridcell"><button type="button" class="date-picker-day is-outside" tabindex="-1" data-date="2026-08-31" data-action="midwest-date-picker#selectDate" aria-label="August 31, 2026">31</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-01" data-action="midwest-date-picker#selectDate" aria-label="September 1, 2026">1</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-02" data-action="midwest-date-picker#selectDate" aria-label="September 2, 2026">2</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-03" data-action="midwest-date-picker#selectDate" aria-label="September 3, 2026">3</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-04" data-action="midwest-date-picker#selectDate" aria-label="September 4, 2026">4</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-05" data-action="midwest-date-picker#selectDate" aria-label="September 5, 2026">5</button></td> </tr> <tr> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-06" data-action="midwest-date-picker#selectDate" aria-label="September 6, 2026">6</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-07" data-action="midwest-date-picker#selectDate" aria-label="September 7, 2026">7</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-08" data-action="midwest-date-picker#selectDate" aria-label="September 8, 2026">8</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-09" data-action="midwest-date-picker#selectDate" aria-label="September 9, 2026">9</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-10" data-action="midwest-date-picker#selectDate" aria-label="September 10, 2026">10</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-11" data-action="midwest-date-picker#selectDate" aria-label="September 11, 2026">11</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-12" data-action="midwest-date-picker#selectDate" aria-label="September 12, 2026">12</button></td> </tr> <tr> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-13" data-action="midwest-date-picker#selectDate" aria-label="September 13, 2026">13</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-14" data-action="midwest-date-picker#selectDate" aria-label="September 14, 2026">14</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-15" data-action="midwest-date-picker#selectDate" aria-label="September 15, 2026">15</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-16" data-action="midwest-date-picker#selectDate" aria-label="September 16, 2026">16</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-17" data-action="midwest-date-picker#selectDate" aria-label="September 17, 2026">17</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-18" data-action="midwest-date-picker#selectDate" aria-label="September 18, 2026">18</button></td> <td role="gridcell"><button type="button" class="date-picker-day is-today" tabindex="0" data-date="2026-09-19" data-action="midwest-date-picker#selectDate" aria-label="September 19, 2026">19</button></td> </tr> <tr> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-20" data-action="midwest-date-picker#selectDate" aria-label="September 20, 2026">20</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-21" data-action="midwest-date-picker#selectDate" aria-label="September 21, 2026">21</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-22" data-action="midwest-date-picker#selectDate" aria-label="September 22, 2026">22</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-23" data-action="midwest-date-picker#selectDate" aria-label="September 23, 2026">23</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-24" data-action="midwest-date-picker#selectDate" aria-label="September 24, 2026">24</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-25" data-action="midwest-date-picker#selectDate" aria-label="September 25, 2026">25</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-26" data-action="midwest-date-picker#selectDate" aria-label="September 26, 2026">26</button></td> </tr> <tr> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-27" data-action="midwest-date-picker#selectDate" aria-label="September 27, 2026">27</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-28" data-action="midwest-date-picker#selectDate" aria-label="September 28, 2026">28</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-29" data-action="midwest-date-picker#selectDate" aria-label="September 29, 2026">29</button></td> <td role="gridcell"><button type="button" class="date-picker-day" tabindex="-1" data-date="2026-09-30" data-action="midwest-date-picker#selectDate" aria-label="September 30, 2026">30</button></td> <td role="gridcell"><button type="button" class="date-picker-day is-outside" tabindex="-1" data-date="2026-10-01" data-action="midwest-date-picker#selectDate" aria-label="October 1, 2026">1</button></td> <td role="gridcell"><button type="button" class="date-picker-day is-outside" tabindex="-1" data-date="2026-10-02" data-action="midwest-date-picker#selectDate" aria-label="October 2, 2026">2</button></td> <td role="gridcell"><button type="button" class="date-picker-day is-outside" tabindex="-1" data-date="2026-10-03" data-action="midwest-date-picker#selectDate" aria-label="October 3, 2026">3</button></td> </tr> </tbody> </table> </section> <footer class="date-picker-footer"> <button type="button" data-action="midwest-date-picker#selectToday" class="midwest-button variant-ghost size-small theme-primary" name="button"> <span class="midwest-button-content">Today</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> <button type="button" data-action="midwest-date-picker#clear" class="midwest-button variant-ghost size-small theme-primary" name="button"> <span class="midwest-button-content">Clear</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></div>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<%lbl = params[:label].presenceval = params[:value].presenceph = params[:placeholder].presence || 'Select a date'min_date = params[:min].presencemax_date = params[:max].presenceis_disabled = params[:disabled] == trueis_required = params[:required] == true%><div class="p-8 max-w-sm"> <%= midwest_date_picker( name: 'playground_date', label: lbl, value: val, placeholder: ph, min: min_date, max: max_date, disabled: is_disabled, required: is_required ) %></div>Playground
Explore the component with live parameters.
| Param | Description | Input |
|---|---|---|
|
Field label |
|
|
|
Date value (YYYY-MM-DD) |
|
|
|
Placeholder text |
|
|
|
Min date (YYYY-MM-DD) |
|
|
|
Max date (YYYY-MM-DD) |
|
|
|
Disabled |
|
|
|
Required |
|
No assets to display.
Add a .js or .css file alongside the component to see it here.
Figma embed for Date Picker/playground
Annotate a preview to embed its Figma design here:
@figma "https://figma.com/..."