Glin UI
Primitive / AtomAdapted from Magic UIbeta

Hyper Text

Text that scrambles through random characters and settles on the real string, on hover, in view or on mount.

Edit on GitHub
Changelog
Version 0.4 is live

Hover the headline to scramble it again.

Installation

Install from
pnpm dlx @glinui/cli@latest add hyper-text

Credits. Adapted from Magic UI (MIT, (c) Magic UI). Design tokens, no motion dependency (rAF scramble), real text kept for screen readers, reduced motion levels, trigger modes and SSR safe first paint. Attribution details.

Prefer the package?

Usage

Improvements: no motion dependency (a single rAF loop), per code point cells with no layout shift, graphemes kept together for emoji and combining marks, view and mount triggers, SSR renders the final text so there is no hydration mismatch, and every frame and timer is cancelled on unmount.

Engines: this component drives its main animation through the pluggable motion engine. Pass `engine` (css, motion or gsap), wrap a subtree in `MotionEngineProvider`, or set `data-glin-engine` on `<html>`. The css engine is built in and dependency free; motion and gsap are opt-in via `@glinui/motion/register/*`. `motion="none"` renders the final state and `subtle` is opacity only.

On view with custom characters

Runs once when scrolled into view, scrambling through binary digits.

Decrypting signal

import { HyperText } from "@glinui/ui"
export function Demo() {
return (
<HyperText trigger="view" characterSet="01" duration={1200} as="h3">
Decrypting signal
</HyperText>
)
}

Proportional glyphs

Turn off tabular cells to use the natural font width.

Mixed width
import { HyperText } from "@glinui/ui"
export function Demo() {
return <HyperText tabular={false} className="font-sans text-2xl">Mixed width</HyperText>
}

Engine comparison

The same component on the css, motion and gsap engines. Replay restarts all three.

CSS

Scramble

Motion

Scramble

GSAP

Scramble
// Same component, three engines. motion and gsap are opt-in:
// import "@glinui/motion/register/motion"
// import "@glinui/motion/register/gsap"
<HyperText engine="css" trigger="mount">Scramble</HyperText>
<HyperText engine="motion" trigger="mount">Scramble</HyperText>
<HyperText engine="gsap" trigger="mount">Scramble</HyperText>

Accessibility

  • The real string is always present in a screen reader only span; the scrambling glyph layer is aria-hidden.
  • Assistive tech never reads random characters.
  • With focusable, keyboard focus triggers the same effect as hover and shows a visible focus ring.

Keyboard Interactions

KeyAction
TabFocus the text (only when focusable is set) to run the scramble.

ARIA Attributes

  • `aria-hidden` on the glyph layer
  • real text in an `sr-only` span

Reduced Motion

With prefers-reduced-motion, or Glin motion level none or subtle, no scramble runs and the final text is shown immediately.

Affected properties

scrambleglyph swaps

API Reference

PropTypeRequiredDefaultDescription
childrenstringYes-The text to reveal. Required.
asHyperTextTagNodivElement to render.
triggerHyperTextTriggerNohoverRun on pointer or focus, once when scrolled into view, or once on mount.
durationnumberNo800Scramble length in milliseconds.
delaynumberNo0Delay before a view or mount run, in milliseconds.
characterSetstring | readonly string[]NoA to ZCharacters used while scrambling.
tabularbooleanNotrueRender each glyph in a one character wide cell so the line width never changes.
focusablebooleanNofalseMake the element tabbable so keyboard users can trigger the hover effect.
engineEngineNameNo-Engine override: `css` (default), `motion`, `gsap` or a registered custom engine.
motionMotionLevelNo-Motion override. `none` renders the static final state, `subtle` is opacity only.

Source

Import directly from the package or browse the source on GitHub. Click any file to view it.

Import

import { HyperText } from "@glinui/ui"

Dependencies

@glinui/ui@glinui/motion

Generated API Snapshot

Beta

Auto-extracted from TypeScript source in packages/ui/src/components/hyper-text.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.

Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata

Primary Props Type

HyperTextProps

HyperTextProps

PropTypeRequiredDefaultDescription
asHyperTextTagNo"div"Element to render.
characterSetstring | readonly string[]NoDEFAULT_CHARACTER_SETCharacters used while scrambling. Defaults to A to Z.
childrenstringYes-The text to reveal.
delaynumberNo0Delay before an automatic run (view or mount) in milliseconds.
durationnumberNo800Scramble length in milliseconds.
engineEngineNameNo-Engine override: `css` (default), `motion`, `gsap` or a registered custom engine.
focusablebooleanNofalseMake the element tabbable so keyboard users can trigger the hover effect.
motionMotionLevelNo-Motion override. `none` renders the static final state, `subtle` is opacity only.
tabularbooleanNotrueRender every glyph in a one character wide cell so the line never changes width.
triggerHyperTextTriggerNo"hover"When the scramble runs: pointer or keyboard focus, once in view, or once on mount.