1.0.0 • Published 8 months ago

react-spltjs v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

SpltJS for React with Type Safety

Install

$ npm i react-spltjs

Basic Usage

import Splt from 'react-spltjs';

const App = () => (
  <>
    <Splt text="Hello World" />;
  </>
);

export default App;

Advanced Usage with Tailwind

import Splt from 'react-spltjs';

const myArray = [
  ['text-red-500'],
  ['text-orange-500'],
  ['text-amber-500'],
  ['text-yellow-500'],
  ['text-lime-500'],
  [], // no need to fill, whtspc char
  ['text-green-500'],
  ['text-emerald-500'],
  ['text-teal-500'],
  ['text-cyan-500'],
  ['text-sky-500'],
];

const App = () => (
  <>
    <h2>
      <Splt
        text="Hello World"
        array={myArray}
        // takes an array, gives classes to each character

        className="md:inline-block animate-loadIn motion-reduce:animate-none"
        // setting inline-block is important for translates
        // but does break-words at small viewport widths
        // suggest setting a breakpoint

        speed={0.2}
        // adjusts total animation duration, default: 0

        offset={0.09}
        // adjusts character animation duration, default: 0.05

        ease="cubic-bezier(0.5,0.5,.2,1.5)"
        // default: 'ease'
      />;
    </h2>
  </>
);

export default App;

Documentation

Contributors

Support

1.0.0

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago