@twistezo/react-text-scramble
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

React text scramble effect

  • React & TypeScript component
  • lightweight package ~7kB

Live example

Setup

npm install @twistezo/react-text-scramble
or
yarn add @twistezo/react-text-scramble

Usage

const texts: ScrambleTexts = [
  'lorem ipsum',
  'dolor sit amet',
  'consectetur adipiscing elit'
]

<TextScramble texts={texts} />

Types and props

type ScrambleText = string

type ScrambleTexts = ScrambleText[]

type TextScrambleProps = {
  texts: ScrambleTexts
  className?: string
  letterSpeed?: number // [ms]
  nextLetterSpeed?: number // [ms]
  paused?: boolean
  pauseTime?: number // [ms]
}

Defaults

letterSpeed = 5
nextLetterSpeed = 100
paused = false
pauseTime = 1500

Package Sidebar

Install

npm i @twistezo/react-text-scramble

Weekly Downloads

120

Version

1.0.6

License

MIT

Unpacked Size

7.77 kB

Total Files

14

Last publish

Collaborators

  • twistezo