# Hyper Text

- Page: https://jiguang132.com/resources/magic-ui/docs/hyper-text
- Resource: Magic UI (https://jiguang132.com/resources/magic-ui.md)
- All guides: https://jiguang132.com/resources/magic-ui/docs.md

Install: `npx shadcn@latest add https://jiguang132.com/r/magic-ui/hyper-text.json`

## Use case

Resolve a scrambled character sequence into text.

## Native props used by the examples

Extracted from all local examples for this entry, grouped by imported module and native owner, including other Magic components used by compound demos. This is not an exhaustive API or a universal host variant. Inspect spread object declarations and the source types/defaults below.

| Owning component prop | Explanation | Example source |
| --- | --- | --- |
| `HyperText.children` (hyper-text) | Native child content; keep the owning component's text/element constraints. | `examples/hyper-text-demo.tsx` |

## Interaction and state checks

- Hyper Text Demo — `hyper-text-demo`

These names identify real example entries, not new component props or extra components. Check pointer/keyboard behavior, themes, small screens and failures for the selected example. Decorative effects must not invent disabled/error/submission states. Complete example installation includes the actual dependency closure.

## Business integration boundary

The effect is decorative; it is not encryption, password protection or generated AI output.

## Host and motion setup

Initialize Tailwind CSS v4, semantic CSS variables and the dark variant; import the independent local Registry namespace. Reuse an existing next-themes Provider without substituting JGuang UI/Base UI/HeroUI APIs. Mount effects in view and unmount offscreen; provide static alternatives for unavailable Canvas/WebGL or failed remote media. Respect prefers-reduced-motion and verify timer/RAF/observer/listener cleanup: stopping CSS alone does not prove the engine stopped. Examples provide no backend, login, payment or real AI stream. This practical guide is bilingual; detailed upstream references and demo text retain their original language.


## Available examples

hyper-text-demo

Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.




## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>
<TabsContent value="cli">

```bash
npx shadcn@latest add @magicui/hyper-text
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Install the following dependencies:</Step>

```bash
npm install motion
```

<Step>Copy and paste the following code into your project.</Step>



<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</Tabs>

## Usage

```tsx showLineNumbers
import { HyperText } from "@/components/ui/hyper-text"
```

```tsx showLineNumbers
<HyperText>Hover me</HyperText>
```

## Props

| Prop             | Type                                                                                                       | Default | Description                                   |
| ---------------- | ---------------------------------------------------------------------------------------------------------- | ------- | --------------------------------------------- |
| `children`       | `string`                                                                                                   | `-`     | Text content to animate                       |
| `className`      | `string`                                                                                                   | `-`     | The class name to be applied to the component |
| `duration`       | `number`                                                                                                   | `800`   | Duration of the animation in milliseconds     |
| `delay`          | `number`                                                                                                   | `0`     | Delay before animation starts (in ms)         |
| `as`             | `"article" \| "div" \| "h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| "li" \| "p" \| "section" \| "span"` | `"div"` | Component to render as                        |
| `startOnView`    | `boolean`                                                                                                  | `false` | Start animation when component is in view     |
| `animateOnHover` | `boolean`                                                                                                  | `true`  | Enable hover animation                        |
| `characterSet`   | `string[]`                                                                                                 | `A-Z`   | Custom character set for scramble effect      |




## Complete example installation

The component command installs the component. Each example command also includes its actual imported components, native support UI, utilities and pinned dependencies. Helpers are not additional catalog components.

### Hyper Text Demo

```bash
npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/hyper-text/hyper-text-demo.json
```

Default import: `@/components/magicui/examples/hyper-text-demo`

Dependencies: `clsx@2.1.1`, `motion@12.42.2`, `tailwind-merge@3.6.0`

### Minimal usage and theme

```tsx
import Demo from '@/components/magicui/examples/hyper-text-demo';
import { ThemeProvider } from 'next-themes';
export default function Example() {
  return <ThemeProvider attribute="class" defaultTheme="system" enableSystem><Demo /></ThemeProvider>;
}

```

Initialize Tailwind CSS v4, semantic color variables and the dark variant first. Reuse an existing next-themes provider rather than nesting another. Next Link examples require a Next.js environment; in static Vite projects adapt the demo links to your router without changing the native component API. Some media and tweets require network access. Examples do not supply authentication or backend services.


## Source-backed parameter reference

Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.


```ts
HyperText({
  children,
  className,
  duration = 800,
  delay = 0,
  as: Component = "div",
  startOnView = false,
  animateOnHover = true,
  characterSet = DEFAULT_CHARACTER_SET,
  ...props
}: HyperTextProps)
```



```ts
type CharacterSet = string[] | readonly string[]

type MotionElementType = Extract<
  keyof DOMMotionComponents,
  keyof typeof motionElements
>

interface HyperTextProps extends Omit<MotionProps, "children"> {
  /** The text content to be animated */
  children: string
  /** Optional className for styling */
  className?: string
  /** Duration of the animation in milliseconds */
  duration?: number
  /** Delay before animation starts in milliseconds */
  delay?: number
  /** Component to render as - defaults to div */
  as?: MotionElementType
  /** Whether to start animation when element comes into view */
  startOnView?: boolean
  /** Whether to trigger animation on hover */
  animateOnHover?: boolean
  /** Custom character set for scramble effect. Defaults to uppercase alphabet */
  characterSet?: CharacterSet
}
```


### Destructuring defaults in source

Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.


```ts
// HyperText
duration = 800

// HyperText
delay = 0

// HyperText
as = "div"

// HyperText
startOnView = false

// HyperText
animateOnHover = true

// HyperText
characterSet = DEFAULT_CHARACTER_SET
```


### Native and external types

External types remain defined by React or native dependencies, not manually expanded into guessed props. The installed version's TypeScript definitions are authoritative.


```ts
Omit<MotionProps, "children">
MotionProps
Extract<
  keyof DOMMotionComponents,
  keyof typeof motionElements
>
DOMMotionComponents
```

---

Index of all JGuang resources: https://jiguang132.com/llms.txt
