Loading preview
Blur Text
Text animationsText whose words rise out of a blur one after another.
Counts up to a number when it scrolls into view, with locale-aware formatting.
npx shadcn@latest add @venusui/number-tickerRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/number-ticker.tsxThe code behind the preview above.
number-ticker-demo.tsx
import { NumberTicker } from "@/components/ui/number-ticker"
export default function NumberTickerDemo() {
return (
<div className="grid w-full max-w-md grid-cols-2 gap-6 text-center">
<div>
<NumberTicker value={12480} className="text-4xl font-semibold tracking-tight" />
<p className="mt-1 text-sm text-muted-foreground">Installs</p>
</div>
<div>
<NumberTicker value={99.95} decimals={2} className="text-4xl font-semibold tracking-tight" />
<span className="text-4xl font-semibold">%</span>
<p className="mt-1 text-sm text-muted-foreground">Uptime</p>
</div>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | — | Number to count to. Required. |
| from | number | 0 | Number to start from. Can be larger than value to count down. |
| duration | number | 2000 | Animation length, in milliseconds. |
| decimals | number | 0 | Digits after the decimal point. |
| locale | string | — | Locale for formatting, e.g. en-IN for 1,00,000. Defaults to the visitor’s locale. |
| formatOptions | Intl.NumberFormatOptions | — | Extra formatting, e.g. { style: "currency", currency: "INR" }. |
All <span> props except children.
cn helper at @/lib/utils. No other dependencies.formatOptions={{ style: "percent" }} with a value like 0.42 for percentages, or notation: "compact" for 12K-style numbers.locale to format the same way for every visitor; otherwise the browser’s locale is used.locale so the server-rendered start value and the animated value use the same format.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.Text whose words rise out of a blur one after another.
Text filled with a slowly moving gradient: a subtle sheen by default, or your own colors.
Cycles through words with a vertical slide, pausing on hover.