JSPM

@twistezo/react-text-scramble

1.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 35
  • Score
    100M100P100Q71639F
  • License MIT

React text scramble effect

Package Exports

  • @twistezo/react-text-scramble

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@twistezo/react-text-scramble) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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