Forms
Textarea with Character Count
Wrap your <textarea></textarea> in .quanta-textarea-wrapper to get built-in padding, focus styling, and an auto‑updating character‑count badge via .quanta-char-count. Supports dynamic resizing and theming.
Markup
Structure your textarea like this:
<div class="quanta-textarea-wrapper">
<textarea id="myTextarea" class="quanta-textarea" maxlength="200" placeholder="Type your message..."></textarea>
<div class="quanta-char-count" data-target="myTextarea">0 / 200</div>
</div>
0 / 200
Behavior
A small snippet of JS (not shown here) should:
- Listen for
inputevents on the textarea. - Read its
value.lengthandmaxlength. - Update the corresponding
.quanta-char-counttext.
It gracefully handles dynamic maxlength changes and lets users resize vertically.
Dark Mode
The textarea and badge adapt automatically:
.quanta-textareagets transparent background and light text in dark mode..quanta-char-countswitches to white text.