Hyper Text

A text animation that scrambles letters before revealing the final text.

motion-sv

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/hyper-text.json

Usage

<script lang="ts">	import { HyperText } from "#lib/components/magic/hyper-text/index.js";</script>
<HyperText text="Hover me" />

Examples

Hex Character Set

Scramble a revision identifier using only hexadecimal characters.

Revision

Delayed Reveal

Reveal a section heading after a short delay, with hover replay disabled.

Changes, fixes, and migration guides.

Numeric Characters

Reveal a build number using only digits in the scramble.

build number

Props

Hyper Text

A component for Hyper Text.

NameTypeDefaultDescription
textstringundefinedThe text content to be animated
classClassValue""Additional CSS classes to apply
durationnumber800Duration of the animation in milliseconds
delaynumber0Delay before animation starts in milliseconds
as"div" | "span" | "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6""div"Component to render as
startOnViewbooleanfalseWhether to start animation when element comes into view
animateOnHoverbooleantrueWhether to trigger animation on hover
characterSetstring[] | readonly string[]ABCDEFGHIJKLMNOPQRSTUVWXYZCustom character set for scramble effect