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
<div class="p-8 max-w-sm flex flex-col gap-4"> <div class="midwest-input midwest-form-group type-textarea" data-controller="midwest-input"> <div class="midwest-form-group__top"> <label class="midwest-label " for="bio-12d58"> Bio </label> </div> <textarea name="bio" id="bio-12d58" placeholder="Tell us a little about yourself…" maxlength="160" data-midwest-input-target="input"></textarea> <div class="midwest-input-counter"> <span data-midwest-input-target="counter">0</span>/160 </div> </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="title-12d60"> Title </label> </div> <input type="text" name="title" id="title-12d60" placeholder="Article title" maxlength="80" data-midwest-input-target="input" /> <div class="midwest-input-counter"> <span data-midwest-input-target="counter">0</span>/80 </div> </div></div>1
2
3
4
5
<div class="p-8 max-w-sm flex flex-col gap-4"> <%= midwest_form_input(name: :bio, label: "Bio", type: :textarea, maxlength: 160, placeholder: "Tell us a little about yourself…") %> <%= midwest_form_input(name: :title, label: "Title", maxlength: 80, placeholder: "Article title") %></div>Counter
Set maxlength: and the component automatically shows a live
character counter below the input. Pass counter: false to suppress
the counter even when maxlength is set.
No params configured.
No assets to display.
Add a .js or .css file alongside the component to see it here.
Figma embed for Input/counter
Annotate a preview to embed its Figma design here:
@figma "https://figma.com/..."