Bencho Originals
95

Features

  • Odometer digits: only the places that change move.
  • Direction-aware: counting up rolls new digits in from below, counting down from above.
  • Press and hold − or + to repeat: there's a 420ms wait, then a step every 90ms.
  • Drag the number up or down to scrub, one step per 9px.
  • The width springs when a digit is added or dropped (99 → 100).
  • The value is clamped to min and max.

API reference

<RollingCounter /> from components/bencho/rolling-counter.tsx

PropTypeDefaultDescription
defaultValuenumber95Starting value.
minnumber0Lowest value.
maxnumber99999Highest value.
stepnumber1Amount per press, repeat tick, arrow key or 9px of drag.

Keyboard interactions

TabMoves between −, the number and +.
Enter / SpaceOn − or +, steps once.
↑ / ↓On the number, steps up or down.

Accessibility

  • The number is a role="spinbutton" with aria-valuenow, aria-valuemin and aria-valuemax.
  • The − and + buttons are labelled “Less” and “More”.
  • The rolling digits are decoration. The value is exposed through the spinbutton's ARIA values.
  • RollingDigits is exported on its own too, for any number that should roll.

Sound & haptics

Silent by design: no audio and no vibration. All of the feedback is visual, so it works anywhere, muted or not.

Files

Written from scratch for sher.md and inspired by bencho.dev. It contains none of bencho's code or assets.