Kinetic Numeral
A modular Swiss-grid numeral with interruptible digit morphs, configurable geometry, and reduced-motion support.
- Dependencies (1)
Features
- Morphs between numerals using a modular three-column grid and interruptible animation.
- Includes ping-pong and ascending count sequences, plus manual click and keyboard controls.
- Offers glacial, auto, obsidian, and paper palettes with adjustable block radius, gap, duration, and stretch.
- Pauses autoplay when reduced motion is enabled; the playback control lets users start or stop it manually.
- Uses SVG geometry and
requestAnimationFramewithout per-frame React renders.
Use cases
- Animated counters and metric highlights.
- Portfolio, editorial, or product pages that need a distinctive numeral display.
- Interactive motion specimens and design explorations.
Installation
pnpm dlx shadcn@latest add @abushaidislam/kinetic-numeral
Usage
import { KineticNumeral } from "@/components/kinetic-numeral"export function Metric() {
return (
<KineticNumeral
digit={7}
autoPlay={false}
palette="auto"
onDigitChange={(digit) => console.log("Displayed digit:", digit)}
/>
)
}Set autoPlay to false to use digit as the displayed value. When autoplay is enabled, the selected sequence controls the displayed digits. Users can click the numeral or use the arrow keys to change it; the playback control and Space key pause or resume the sequence.
API reference
KineticNumeral
Prop
Type
Accessibility
- Uses a labeled group with keyboard support for arrow keys and direct digit entry.
- Includes a visible, keyboard-accessible play/pause control.
- Announces manual digit changes politely and silences the live region during autoplay.
- Respects
prefers-reduced-motionby pausing autoplay and snapping transitions to their final geometry.
License and usage
- Free to use and modify in both personal and commercial projects.
- Attribution is appreciated but not required.
- Released under the MIT License.
Every component here is built and maintained by one person. If you enjoy using them, you can sponsor my work.