Loading preview
Blur Text
Text animationsText whose words rise out of a blur one after another.
Resolves text from random characters, left to right, like a decoder.
npx shadcn@latest add @venusui/scramble-textRun 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/scramble-text.tsxThe code behind the preview above.
scramble-text-demo.tsx
import { ScrambleText } from "@/components/ui/scramble-text"
export default function ScrambleTextDemo() {
return (
<div className="space-y-3 text-center">
<ScrambleText as="h2" text="ACCESS GRANTED" className="text-3xl font-semibold tracking-widest" />
<p className="text-sm text-muted-foreground">
Hover me: <ScrambleText trigger="hover" text="decrypting…" className="text-foreground" />
</p>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| text | string | — | The final text. Required. |
| as | "span" | "p" | "h1" | "h2" | "h3" | "span" | Element to render. |
| trigger | "view" | "hover" | "mount" | "view" | Scramble when it enters the viewport, on hover and focus, or once on mount. |
| duration | number | 900 | Milliseconds until every character has settled. |
| characters | string | — | Characters used while scrambling. |
| className | string | — | Classes for the element. Uses a monospace font by default so width stays stable. |
Only the props above.
cn helper at @/lib/utils. No other dependencies.characters="01" for a binary look or "アイウエオカキクケコ" for katakana.aria-hidden.trigger="view" it runs once when 60% of it is visible. Check that it actually scrolls into view, or use trigger="mount".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.
Counts up to a number when it scrolls into view, with locale-aware formatting.