Todos os componentes

Animated Number

Animated Number é um componente de texto para React e Tailwind CSS, da biblioteca Motion Primitives, com licença MIT. Copia e cola no teu projeto.

Motion Primitives MIT text

O que é

Animated Number é um componente de texto para React e Tailwind CSS, da biblioteca Motion Primitives, com licença MIT. Copia e cola no teu projeto.

Como usar

Abre o componente no catálogo, carrega em copiar, e cola no teu projeto. O prompt copiado leva o código e as regras para o teu agente o reproduzir sem alterar nada.

Abrir no catálogo

Cinco cópias grátis por mês. Sem cartão.

Precisa de

npm i lucide-react

Licença

Este componente vem de Motion Primitives e é redistribuído sob a licença MIT, que permite uso comercial. O aviso de copyright viaja com o código.

Animated Number

app/docs/animated-number/animated-number-counter.tsx
'use client';
import { useState } from 'react';
import { AnimatedNumber } from '@/components/core/animated-number';
import { Minus, Plus } from 'lucide-react';

export function AnimatedNumberCounter() {
  const [value, setValue] = useState(1000);

  return (
    <div className='flex w-full items-center justify-center space-x-2 text-zinc-800 dark:text-zinc-50'>
      <button
        aria-label='Decrement'
        onClick={() => setValue((prev) => prev - 100)}
      >
        <Minus className='h-4 w-4' />
      </button>
      <AnimatedNumber
        className='inline-flex items-center font-mono text-2xl font-light'
        springOptions={{
          bounce: 0,
          duration: 1000,
        }}
        value={value}
      />
      <button
        aria-label='Increment'
        onClick={() => setValue((prev) => prev + 100)}
      >
        <Plus className='h-4 w-4' />
      </button>
    </div>
  );
}

Componentes parecidos