Garvit Galgat

2021 · NPM PACKAGE

React Animated Digits

From a Reddit post to an npm package

View source

React · TypeScript · SCSS · Rollup · npm

I saw a Reddit video of a clock made from clocks. The little clock hands moved together to form the digits.

Could I build that in my browser?

The inspiration

Loading the Reddit post…

Watch the original on Reddit ↗

My component

0 → 9 → 0
This is the component I built.

Getting it to move

I tried recreating it as a React component, and it worked in the browser. Seeing it run made me want to take it a little further. Could I publish it so someone else could use it too?

Could I publish it?

I started reading about publishing packages to npm. A guide I was following used TypeScript, so this became the project where I started learning TypeScript too. I followed along and began to see how it could help me.

I figured out the publishing steps and got the component onto npm. Now someone could install what I had built. A browser experiment had taught me how to publish a package as well.

View npm package