1.1.1 • Published 9 months ago

react-animated-text-builders v1.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
9 months ago

react-animated-text-builders

A ReactJS library to animate an appearing text.

NPM JavaScript Style Guide

Demo

gif

gif

www.movcmpret.com/demo/animated-text-builders/

Install

npm install --save react-animated-text-builders

Usage

import React, { Component } from 'react'

import { BlinkingCursorTextBuilder } from 'react-animated-text-builders'

class Example extends Component {
  render() {
    return <>
      <BlinkingCursorTextBuilder
      textStyle={{fontWeight :"bold", font : "Times New Roman", fontSize : "18px"}}
      style={{transform: "rotate(-10deg)", marginTop:"10px", marginBottom :"10px"}}
      cursorComponent={<div style={{color : "green"}}> Easy to use!</div>}
      blinkTimeAfterFinish={-1}> Easy! </BlinkingCursorTextBuilder>

      <FloatingLettersTextBuilder
        floatingSpeed={500}
        lettersAppearanceDelay={250}
        animationMaxMargin={"200px"}
        animationMinMargin={"0px"}
        onAnimationFinished={()=> {alert("Animation Finished!")}}
      > Floating Letters </FloatingLettersTextBuilder>
      </>
  }
}

Props

BlinkingCursorTextBuilder

NameTypeFunctionDefault
timeoutPropTypes.numberTimeout (in ms) per letter100
blinkTimeAfterFinishPropTypes.numberBlinking time in ms after animation-
cursorStylePropTypes.objectStyles to be applied to the cursor div-
blinkingSpeedPropTypes.numberBlinking speed in ms-
cursorComponentPropTypes.elementCustom cursor component (disables cursorStyle)-
textStylePropTypes.objectStyles to be applied to the (string) child-
onBlinkingFinishedPropTypes.funcCallback that is fired when the blinking ended.-

FloatingLettersTextBuilder

NameTypeFunctionDefault
childrenPropTypes.string.isRequiredText to be displayed-
floatingSpeedPropTypes.numberspeed of the CSS floating animation in ms500
floatingStylePropTypes.stringstyle of the CSS floating animation (FLOATING_STYLE)FLOATING_STYLE.EASE_IN_OUT
lettersAppearanceDelayPropTypes.numberthe delay between each letter to be displayed100
letterStylePropTypes.objectStyle of each letter{}
letterSpacingPropTypes.stringSpacing between letters (space-letters are not recognized)"4px"
animationMinMarginPropTypes.stringThe min/end margin of the animation"0px"
animationMaxMarginPropTypes.stringThe max/initial margin of the animation"100px"
onAnimationFinishedPropTypes.funcFunction is called after the animation finished-

License

MIT © movcmpret

1.1.1

9 months ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago