TypewriterText
component provides an animated typing effect with adaptive speed based on text length. It supports markdown rendering, customizable delays, and optional prefix styling.
Prop | Type | Default | Description |
---|---|---|---|
text | string | - | The text to be typed out (required) |
className | string | '' | Additional CSS classes |
charDelay | number | 0.025 | Base character delay in seconds. If default, adaptive speed is used |
minCharDelay | number | 0.002 | Minimum delay for very long texts (fastest speed) |
maxCharDelay | number | 0.04 | Maximum delay for short texts (slowest speed) |
showCursor | boolean | true | Whether to show the typing cursor |
onTypingStart | () => void | - | Callback when typing animation starts |
onTypingComplete | () => void | - | Callback when typing animation completes |
blinking | boolean | false | Whether the cursor should blink |
renderAsMarkdown | boolean | true | Whether to render content as markdown |
prefix | string | '' | Optional prefix text with special styling |
maxCharDelay
(slower)minCharDelay
(faster)charDelay
:
renderAsMarkdown
is true:
useStyling()
hook for consistent theminganimate
function for optimal performance