Maxwell Barvian

Number Flow

Text 529

About

A React component to transition, localize, and format numbers. Dependency-free. Accessible. Customizable.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Number Flow to your project and fits it to your theme.

Code

How Number Flow is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

import { useState } from 'react';
import NumberFlow, { type Value } from "@number-flow/react";

const values: Value[] = [398.43, -3243.5, 1435237];

function NumberFlowDemo() {
  const [currentIndex, setCurrentIndex] = useState(0);

  const handleClick = () => {
    setCurrentIndex((prev) => (prev + 1) % values.length);
  };

  return (
    <div 
      onClick={handleClick}
      className="min-h-screen w-full min-w-[100vw]  flex flex-col items-center justify-center cursor-pointer text-[40px]"
    >
      <div className="pointer-events-none">
        <NumberFlow value={values[currentIndex]} trend={false} />
      </div>
      <p className="absolute bottom-6 text-sm text-gray-500 pointer-events-none">
        Click anywhere to change values
      </p>
    </div>
  );
}

export default { NumberFlowDemo };

Dependencies

More by Maxwell Barvian

View all
  • Slider Number Flow

    Slider Number Flow

    501
  • Activity with Number Flow

    Activity with Number Flow

    124
  • Number Input

    Number Input

    98
  • Number Flow Trends

    Number Flow Trends

    4

More in Text

View all
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    103
  • Motion Blur Text

    Motion Blur Text

    35
  • Rainbow Text Effect

    Rainbow Text Effect

    47
  • Text Reveal

    Text Reveal

    317
  • Blur Reveal

    Blur Reveal

    297
  • NeonRGBTextEffect

    NeonRGBTextEffect

    144
  • Glow

    Glow

    40
  • Apple Hello Effect

    Apple Hello Effect

    606