Skip to content

Typewriter

DisplayMIT
View in Storybook

Character-by-character typewriter text animation with configurable speed.

bun add @otfdashkit/ui

Preview

Typewriter
Loading Storybook preview…

Code

import { Typewriter } from '@otfdashkit/ui'

export function Example() {
  return (
    <div className="text-2xl font-semibold text-foreground">
      Build with{' '}
      <Typewriter words={['speed', 'quality', 'design', 'confidence']} className="text-primary" />
    </div>
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.

Props

Props declared in the Typewriter source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
wordsrequiredstring[]Array of strings to cycle through
as'span' | 'p' | 'div' | 'h1' | 'h2' | 'h3''span'
classNamestring
cursorbooleantrueShow cursor (default true)
cursorCharstring'|'Custom cursor character (default '|')
deleteSpeednumber30Deleting speed in ms per character (default 30)
loopbooleantrueWhether to loop (default true)
pauseAfternumber1800Pause after finishing a word in ms (default 1800)
styleCSSProperties
typeSpeednumber60Typing speed in ms per character (default 60)