- React & TypeScript component
- lightweight package ~7kB
npm install @twistezo/react-text-scramble
or
yarn add @twistezo/react-text-scramble
const texts: ScrambleTexts = [
'lorem ipsum',
'dolor sit amet',
'consectetur adipiscing elit'
]
<TextScramble texts={texts} />
type ScrambleText = string
type ScrambleTexts = ScrambleText[]
type TextScrambleProps = {
texts: ScrambleTexts
className?: string
letterSpeed?: number // [ms]
nextLetterSpeed?: number // [ms]
paused?: boolean
pauseTime?: number // [ms]
}
letterSpeed = 5
nextLetterSpeed = 100
paused = false
pauseTime = 1500