# M sliding number 3

> Pricing plan switcher — price and seat count animate on tier change

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

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

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/m-sliding-number-3.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/sliding-number`

## Files

### `registry/default/motion-variants/m-sliding-number-3.tsx`

```tsx
//biome-ignore-all lint/style/noNonNullAssertion:<>

"use client";

import { useState } from "react";
import { SlidingNumber } from "@/registry/default/motion/sliding-number";

const presets = [
  { label: "Starter", price: 29, seats: 5 },
  { label: "Pro", price: 99, seats: 20 },
  { label: "Enterprise", price: 349, seats: 100 },
];

export default function SlidingNumberPricing() {
  const [active, setActive] = useState(0);
  const plan = presets[active]!;

  return (
    <div className="flex min-h-50 flex-col items-center justify-center gap-5 px-6">
      <div className="flex gap-2">
        {presets.map((p, i) => (
          <button
            className={`rounded-md px-3 py-1.5 font-medium text-sm transition-colors ${
              i === active
                ? "bg-foreground text-background"
                : "bg-accent text-muted-foreground hover:text-foreground"
            }`}
            key={p.label}
            onClick={() => setActive(i)}
            type="button"
          >
            {p.label}
          </button>
        ))}
      </div>
      <div className="rounded-2xl border border-border bg-card p-6 text-center">
        <div className="flex items-start justify-center gap-0.5">
          <span className="mt-2 font-semibold text-foreground text-xl">$</span>
          <span className="font-bold text-6xl text-foreground">
            <SlidingNumber value={plan.price} />
          </span>
          <span className="mt-4 text-muted-foreground text-sm">/mo</span>
        </div>
        <div className="mt-2 text-muted-foreground text-sm">
          Up to <SlidingNumber value={plan.seats} /> seats
        </div>
      </div>
    </div>
  );
}
```
