An open API service indexing awesome lists of open source software.

https://github.com/bitttttten/mechanical-counter

A mechanical counter as seen on Robinhood. Recreated with framer-motion for react.
https://github.com/bitttttten/mechanical-counter

counter framer framer-motion mechanical react robinhood

Last synced: 6 months ago
JSON representation

A mechanical counter as seen on Robinhood. Recreated with framer-motion for react.

Awesome Lists containing this project

README

          

✨ mechanical counter ✨


robinhood inspired mechanical counter


built with react and framer-motion




👉 live preview 👈



[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Github release version](https://img.shields.io/github/tag/bitttttten/mechanical-counter.svg)](https://github.com/bitttttten/mechanical-counter/releases)
[![Commits since release](https://img.shields.io/github/commits-since/bitttttten/mechanical-counter/v1.0.15.svg)](https://github.com/bitttttten/mechanical-counter/compare/v1.0.15...main)
[![npm release version](https://img.shields.io/npm/v/mechanical-counter.svg)](https://www.npmjs.com/package/mechanical-counter)

![preview](./docs/preview.webp)

## Install

```sh
npm i framer-motion mechanical-counter
```

## Usage

```js
import { MechanicalCounter } from "mechanical-counter";

export function App() {
return ;
}
```

### Help

The component will only animate numbers and common number separators: `,`, `.`, and `-`. If you want to include text before the number, then you must include that along side the component. It's totally fine to include non-supported characters in the text you send in to the component through the "text" prop, however, they must be added as a suffix to the text.

Here is an example of adding text before the number, as a prefix, and also including some plain text—that is "unsupported characters"—after the number, as a suffix.

```js


EU€


```

The code above will result in the following:

![preview](./docs/preview-2.webp)