Count
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initFieldCount(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/input-countAbout this component
A character counter and progress bar slide in below the input on first focus or keystroke. The counter and bar color shift from dim → light gray → white as the character limit approaches. Both slide away again when the field is empty and blurred.
Triggers
- Focus
- State change
Techniques
- Transform only
Difficulty
Beginner
Accessibility
Keyboard and screen readers
Counter is always in the DOM (opacity 0 when hidden) so screen readers can announce it.
Reduced motion
Under reduced motion, skip the slide-in transform.
Use it in anything you build, commercial and client work included. Licence