# M animated number 1

> Stepper — +10/-10 buttons spring the figure through intermediate values

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/m-animated-number-1).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/m-animated-number-1
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/m-animated-number-1-light-dac365b548f725df.png
- Registry item: https://ui.cnippet.dev/r/m-animated-number-1.json
- Categories: animated number
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-animated-number-1.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/animated-number`

## Files

### `registry/default/motion-variants/m-animated-number-1.tsx`

```tsx
"use client";

import { useState } from "react";
import { AnimatedNumber } from "@/registry/default/motion/animated-number";

export default function AnimatedNumberStepper() {
  const [value, setValue] = useState(42);

  return (
    <div className="flex min-h-50 flex-col items-center justify-center gap-6 px-6">
      <p className="font-bold text-6xl text-foreground tabular-nums">
        <AnimatedNumber
          springOptions={{ damping: 20, stiffness: 180 }}
          value={value}
        />
      </p>
      <div className="flex gap-2">
        <button
          className="rounded-md border border-border px-4 py-2 font-medium text-sm hover:bg-accent"
          onClick={() => setValue((v) => Math.max(0, v - 10))}
          type="button"
        >
          −10
        </button>
        <button
          className="rounded-md bg-foreground px-4 py-2 font-medium text-background text-sm hover:bg-foreground/80"
          onClick={() => setValue((v) => v + 10)}
          type="button"
        >
          +10
        </button>
      </div>
    </div>
  );
}
```
