npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

supertext-react

v1.0.3

Published

SuperText-react is a versatile React component library that provides three unique text animation and display components: TypingText, LastWordTypingText, and Marquee. With SuperText-react, you can effortlessly add captivating text effects to your web appli

Downloads

13

Readme

Supertext-react

Supertext-react is a versatile React component library that provides three unique text animation and display components: TypingText, LastWordTypingText, and Marquee. With Supertext-react, you can effortlessly add captivating text effects to your web applications. This README will guide you through how to use each component and explain the available props and their functionalities.

Table of Contents

Installation

To use Supertext-react in your project, you can install it via npm or yarn:

npm install Supertext-react

or

yarn add Supertext-react

Usage

TypingText

TypingText is a component that simulates typing animation. It progressively displays text from an array with optional customization.

import React from 'react';
import { TypingText } from 'Supertext-react';

function MyComponent() {
  const texts = ["Hello, world!", "This is Supertext-react.", "Enjoy the animations!"];

  return (
    <TypingText
      textArray={texts}
      typingSpeed={50} // Speed of typing in milliseconds per character
      loop={true} // Loop through the textArray
      fontSize="24px"
      fontWeight="bold"
      color="black"
      className="custom-typing-text"
      triggerOnce={true} // Only trigger once on initial render
    />
  );
}

Props for TypingText Component:

  1. textArray (Array):

    • An array of strings that represent the text to be displayed and typed out.
  2. typingSpeed (Number):

    • The speed at which each character is typed in milliseconds. Smaller values make it faster.
  3. loop (Boolean):

    • Determines whether the animation should loop through the textArray once it reaches the end.
  4. fontSize (String):

    • Sets the font size of the displayed text.
  5. fontWeight (String):

    • Sets the font weight of the displayed text.
  6. color (String):

    • Sets the color of the text.
  7. className (String):

    • Adds a custom CSS class name to the outer div of the component for styling.
  8. triggerOnce (Boolean):

    • Determines whether the animation should trigger only once when the component comes into view.

LastWordTypingText

LastWordTypingText is a component that types out the last word in a sentence, providing a unique effect.

import React from 'react';
import { LastWordTypingText } from 'Supertext-react';

function MyComponent() {
  return (
    <LastWordTypingText
      text="This is a simple example."
      typingSpeed={150}
      loop={false}
      lastWords={["example.", "component.", "effect.", "features."]}
      fontSize="24px"
      fontWeight="bold"
      color="blue"
      className="custom-text"
    />
  );
}

Props for LastWordTypingText Component:

  1. text (String):

    • The initial text before the last word that will be typed.
  2. typingSpeed (Number):

    • The speed at which each character of the last word is typed in milliseconds.
  3. lastWords (Array):

    • An array of words. The component will type out each word sequentially from this array.
  4. loop (Boolean):

    • Determines whether the animation should loop through the lastWords once it reaches the end.
  5. fontSize (String):

    • Sets the font size of the displayed text.
  6. fontWeight (String):

    • Sets the font weight of the displayed text.
  7. color (String):

    • Sets the color of the text.
  8. className (String):

    • Adds a custom CSS class name to the outer div of the component for styling.

Marquee

Marquee is a component that creates a scrolling text effect.

import React from 'react';
import { Marquee } from 'Supertext-react';

function MyComponent() {
  return (
    <Marquee
      text="This is a scrolling text."
      speed={1} // Speed of scrolling (higher value means slower)
      fontSize="24px"
      fontWeight="bold"
      color="blue"
      className="custom-marquee"
      pauseOnHover={true} // Pause scrolling on hover
      scrolldirection="right" // Direction of scrolling ('right' or 'left')
    />
  );
}

Props for Marquee Component:

  1. text (String):

    • The text that will scroll horizontally within the component.
  2. speed (Number):

    • The speed of the scrolling text. A higher value means slower scrolling.
  3. fontSize (String):

    • Sets the font size of the displayed text.
  4. fontWeight (String):

    • Sets the font weight of the displayed text.
  5. color (String):

    • Sets the color of the text.
  6. className (String):

    • Adds a custom CSS class name to the outer div of the component for styling.
  7. pauseOnHover (Boolean):

    • Determines whether the scrolling animation should pause when the mouse hovers over the component.
  8. scrolldirection (String):

    • Defines the direction of text scrolling. It can be either "right" or "left".

These props allow you to customize the behavior and appearance of each Supertext-react component according to your specific requirements.

Examples

For more examples and usage details, you can refer to the demo link procided bellow.

Enjoy using Supertext-react to add engaging text animations and effects to your React applications! If you encounter any issues or have suggestions for improvement, please feel free to open an issue on the GitHub repository.