Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Text

  • Text
  • Heading
  • SectionHeader
  • Prose
  • Markdown
  • Formula
  • AuroraText
  • LineShadowText
  • AnimatedShinyText
  • AnimatedGradientText
  • WordRotate
  • TypingAnimation
  • SparklesText
  • SplitText
  • BlurText
  • FlipText
  • TextReveal
  • DecryptedText
  • GlitchText
  • CircularText
  • ScrollReveal
  • TrueFocus
  • ASCIIText
  • CurvedLoop
  • FallingText
  • FuzzyText
  • ScrambledText
  • ScrollFloat
  • ScrollVelocity
  • Shuffle
  • TextCursor
  • TextPressure
  • VariableProximity

Code

  • Code
  • CodeBlock
  • Snippet
  • CodeDiff
  • Kbd

TypingAnimation

typing-animation

Reveals text character by character with configurable timing and cursor behavior.

Usage

Basic usage

Type the text word by word with a blinking cursor, and automatically hide the cursor after typing.

|
tsx
<TypingAnimation
  text="Hulian, a composable design system"
  className="text-2xl font-semibold text-foreground"
/>

Typing speed

duration controls milliseconds per word (default 80), the smaller the faster.

|
tsx
<TypingAnimation
  text="Faster typing speed"
  duration={40}
  className="text-xl font-medium text-foreground"
/>

Hide cursor

When showCursor=false, the blinking cursor is not rendered and only the typing process is retained.

tsx
<TypingAnimation
  text="Typing effect without cursor"
  showCursor={false}
  className="text-xl font-medium text-foreground"
/>

Enter viewport trigger

startOnView=true (default), scroll into the viewport before starting typing, suitable for long pages.

|
tsx
<TypingAnimation
  text="Scroll here to start typing"
  startOnView
  className="text-xl font-medium text-foreground"
/>

When to use

Use TypingAnimation to reveal a string character by character with a blinking cursor, starting on viewport entry by default. It suits hero slogans and first-screen copy. Use WordRotate to cycle words in a fixed sentence, or Text for static content. State and IntersectionObserver make this a client component.

Import

ts
import { TypingAnimation } from "@hulianui/ui"

Props

NameTypeDefaultDescription
text*string-Text to be typed verbatim
durationnumber80milliseconds per word
delaynumber0Delay in milliseconds before start
startOnViewbooleantrueStart after entering the viewport; set false to start immediately
showCursorbooleantrueShow flashing cursor

Inherit ComponentPropsWithoutRef<"span"> (except children), such as className / style.

Example

tsx
<TypingAnimation
  text="HulianUI, a composable design system"
  className="text-2xl font-semibold text-foreground"
/>

Start immediately (without entering the viewport, often used in the first screen):

tsx
<TypingAnimation text="Hulian" startOnView={false} duration={60} />

Usage guidelines

  • startOnView defaults to true. If the component begins outside the viewport and the page never scrolls (a screenshot or a headless check, say), it remains blank. Set startOnView={false} for immediate first-screen or test rendering.
  • The "use client" component may be nested under a server component but is not itself a pure RSC.

Related

Text · Heading · Prose · Markdown · AuroraText · AnimatedShinyText

Playground

|
<TypingAnimation text="Hulian" duration={80} showCursor={true} />
PreviousWordRotateTypographyNextSparklesText

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Example
    • Usage guidelines
    • Related
  • Playground