Cnippet

Text Scramble

Text 3

About

Characters scramble through random glyphs before resolving to the final text, creating a cipher-decoding effect on mount.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Text Scramble to your project and fits it to your theme.

Code

How Text Scramble is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { useState } from "react";
import { TextScramble } from "@/components/ui/text-scramble";

export default function TextScrambleTrigger() {
  const [trigger, setTrigger] = useState(true);

  function handleClick() {
    setTrigger(false);
    setTimeout(() => setTrigger(true), 50);
  }

  return (
    <div className="flex min-h-50 flex-col items-center justify-center gap-6 px-6">
      <TextScramble
        as="p"
        className="font-medium font-mono text-foreground text-xl uppercase tracking-widest"
        duration={0.8}
        speed={0.04}
        trigger={trigger}
      >
        Decrypt on demand
      </TextScramble>
      <button
        className="rounded-md border border-border bg-background px-4 py-1.5 text-muted-foreground text-sm transition-colors hover:bg-accent hover:text-foreground"
        onClick={handleClick}
        type="button"
      >
        Scramble again
      </button>
    </div>
  );
}

Dependencies

More by Cnippet

View all
  • Team

    Team

    1.3K
  • Davincho Hero-1

    Davincho Hero-1

    683
  • Aero Hero-3

    Aero Hero-3

    558
  • Features

    Features

    510
  • Random Letter Swap Navigation

    Random Letter Swap Navigation

    487
  • Services with Animated Hover Modal

    Services with Animated Hover Modal

    465
  • Blogs

    Blogs

    396
  • Aero Hero-1

    Aero Hero-1

    356

More in Text

View all
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    103
  • Rainbow Text Effect

    Rainbow Text Effect

    47
  • Motion Blur Text

    Motion Blur Text

    36
  • Text Loop

    Text Loop

    310
  • Text Reveal

    Text Reveal

    27
  • Apple Hello Effect

    Apple Hello Effect

    610
  • Typography

    Typography

    4
  • Animated Text

    Animated Text

    8