JSPM

  • Created
  • Published
  • Downloads 216
  • Score
    100M100P100Q101463F
  • License MIT

Package Exports

  • @corex/use-typed

Readme


title: '@corex/use-typed' custom_edit_url: 'https://github.com/iamvishnusankar/corex/edit/master/packages/use-typed/README.md'

Example Usage

Edit trusting-hypatia-frr0z

import React from 'react'
import useTyped from '@corex/use-typed'

export const Hello = () => {
  const typedRef = React.useRef(null)

  useTyped(typedRef, {
    strings: ['example', 'something else', 'another'],
    typeSpeed: 50,
    backSpeed: 30,
    loop: true,
    showCursor: false,
  })

  return (
    <h2>
      Hello,{' '}
      <span
        style={{ color: 'dodgerblue' }}
        className="text-success"
        ref={typedRef}
      />{' '}
      text
    </h2>
  )
}

export default Hello