Skip to content
roguelite labsAnthony Spezzano ↗
Prompt/TokenCounter

TokenCounter

Live token count with spring-animated number and a color-coded fill bar that shifts green→yellow→red as tokens approach the limit.

Use and inspectUse this as a presentational interface around your own submit, stream, or state handlers. Reset preview only remounts the local example; it does not send a request or connect to a model.Next: inspect the source and wire its callback to a bounded backend action.
TokenCounterLive token count with spring-animated number and a color-coded fill bar that shifts green→yellow→red as tokens approach the limit.
npm install framer-motion
This component requires framer-motion.
PropTypeDefaultDescription
value*numberCurrent token count
max*numberMaximum token limit
classNamestringOptional extra CSS class