Scramble Text
Resolves a phrase by cycling random glyphs until it locks in.
Import
tsx
import { ScrambleText } from "@cronus-ui/ui";
bash
npx cronus-ui add scramble-text
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component ScrambleTextDefault layout:inline style:scramble-text {
label "Decode"
}
page "/audit/scramble-text/default" type:custom {
use ScrambleTextDefault
}
API Reference
Generated from the component's exported types.
ScrambleTextProps
Extends Omit<HTMLAttributes<HTMLSpanElement>, "children">
| Prop | Type | Default | Description |
|---|---|---|---|
ref | Ref<HTMLSpanElement> | — | Ref forwarded to the underlying DOM node. |
children* | string | — | The phrase to resolve to. |
speed | number | 40 | Milliseconds between scramble ticks. |
ticksPerGlyph | number | 4 | How many ticks each glyph stays scrambled before locking. |
charset | string | DEFAULT_CHARSET | Glyphs used while scrambling. Defaults to a Latin + digit set. |
reducedMotion | ScrambleTextMotionPreference | "respect" | How `prefers-reduced-motion` is honoured. Defaults to `"respect"` (show the resolved phrase immediately). |
className | string | — | Additional class names merged onto the root. |
id | string | — | DOM id of the root element. |