āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/ibelick/motion-primitives/animated-number/page ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
export const metadata = { title: 'Animated Number - Motion-Primitives', description: 'Easily animate numbers. Built for React, Next.js, and Tailwind CSS.', };
import { AnimatedNumberBasic } from './animated-number-basic'; import { AnimatedNumberCounter } from './animated-number-counter'; import { AnimatedNumberInView } from './animated-number-in-view'; import ComponentCodePreview from '@/components/website/component-code-preview';
Easily animate numbers.
<ComponentCodePreview component={<AnimatedNumberBasic />} filePath='app/docs/animated-number/animated-number-basic.tsx' hasReTrigger classNameComponentContainer='min-h-[250px]' />
<ComponentCodePreview component={<AnimatedNumberCounter />} filePath='app/docs/animated-number/animated-number-counter.tsx' classNameComponentContainer='min-h-[250px]' />
<ComponentCodePreview component={<AnimatedNumberInView />} filePath='app/docs/animated-number/animated-number-in-view.tsx' classNameComponentContainer='min-h-[250px]' />
<Step>Copy and paste the following code into your project.</Step>
<CodeBlock filePath='components/core/animated-number.tsx' /><Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </Tabs>| Prop | Type | Default | Description | | :------------ | :---------------- | :------ | :-------------------------------------------------------- | | value | number | | The number to be animated. | | className | string | | Optional CSS class for styling the number item container. | | springOptions | SpringOptions | | Spring options from motion for the animation. | | as | React.ElementType | 'span' | The HTML tag to render the number in. |
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā