asafefe.dev

Text Scramble

Text that decodes from random characters on hover or on mount.

Full-Stack Developer

Installation

$ pnpm dlx shadcn@latest add @soultel/text-scramble

No namespace set up? npx shadcn@latest add https://asafefe.dev/r/text-scramble.json works too.

Manual installation
  1. 1. Copy the source from the Code tab into components/text-scramble.tsx.

Usage

example.tsx5 lines
import { TextScramble } from "@/components/text-scramble"

export function Example() {
  return <TextScramble text="Full-Stack Developer" />
}

Props

PropTypeDefaultDescription
textstring-Final text.
trigger"hover" | "mount""hover"When to scramble.
durationnumber550Decode time in ms.