Julien Thibeaut

Sliding Number

Text 492

About

A component that slides numbers.

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

Code

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

Usage.tsx

'use client';

import { motion } from 'motion/react';
import { useEffect, useState } from 'react';
import { SlidingNumber } from '@/components/ui/sliding-number';

export function SlidingNumberBasic() {
  const [value, setValue] = useState(0);

  useEffect(() => {
    if (value === 100) return;

    const interval = setInterval(() => {
      setValue(value + 1);
    }, 10);
    return () => clearInterval(interval);
  }, [value]);

  return (
    <motion.div
      initial={{ y: 0, fontSize: `${24}px` }}
      animate={{ y: 0, fontSize: `${24}px` }}
      transition={{
        ease: [1, 0, 0.35, 0.95],
        duration: 1.5,
        delay: 0.3,
      }}
      className='leading-none text-black dark:text-white'
    >
      <div className='inline-flex items-center gap-1 font-mono'>
        <SlidingNumber value={value} />%
      </div>
    </motion.div>
  );
}

Dependencies

More by Julien Thibeaut

View all
  • Dock

    Dock

    3.1K
  • Text Effect

    Text Effect

    1.6K
  • Infinite Slider

    Infinite Slider

    1.5K
  • Text Shimmer

    Text Shimmer

    1.3K
  • Text Scramble

    Text Scramble

    1.1K
  • Progressive blur

    Progressive blur

    683
  • Glow Effect

    Glow Effect

    606
  • Tailwind CSS Background Snippet

    Tailwind CSS Background Snippet

    530

More in Text

View all
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    102
  • Motion Blur Text

    Motion Blur Text

    34
  • Text Reveal

    Text Reveal

    26
  • Blur Reveal

    Blur Reveal

    296
  • Apple Hello Effect

    Apple Hello Effect

    605
  • NeonRGBTextEffect

    NeonRGBTextEffect

    144
  • Top Down Letters

    Top Down Letters

    19
  • Text Loop

    Text Loop

    305