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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-cursive-handwrite

v0.2.6

Published

React component to animate cursive handwriting text

Readme

React Cursive Handwrite

A React component that animates text in a cursive handwriting style using SVG paths. Perfect for creating elegant, animated text effects in your React applications.

Features

  • 🖋️ Smooth cursive handwriting animation
  • 🎨 Customizable stroke color and width
  • ⚡ Adjustable animation duration
  • 📏 Responsive sizing
  • 🎯 Multiple text wrapping options
  • 🔄 Replay animation capability
  • 🎭 Custom SVG path support

Installation

npm install react-cursive-handwrite
# or
yarn add react-cursive-handwrite

Setup

Before using the component, you need to set up the font files. The component expects SVG files for each letter in a specific directory structure:

public/
  fonts/
    google/  # or any other font name you specify
      a.svg
      b.svg
      c.svg
      # ... and so on for each letter

Usage

Basic Usage

import { HandwritingText } from 'react-cursive-handwrite';

function App() {
  return (
    <HandwritingText fontPath="fonts/google">
      Hello World
    </HandwritingText>
  );
}

Advanced Usage

import { HandwritingText } from 'react-cursive-handwrite';

function App() {
  return (
    <HandwritingText 
      fontPath="fonts/google"
      strokeColor="#FF0000"
      strokeWidth={3}
      duration={5}
      width={500}
      height={100}
      replay={true}
      replayDelay={2000}
    >
      Hello World
    </HandwritingText>
  );
}

Using Custom SVG Path

import { HandwritingText } from 'react-cursive-handwrite';

function App() {
  return (
    <HandwritingText 
      path="M 0,0 L 100,100..." // Your custom SVG path
      strokeColor="#FF0000"
      strokeWidth={3}
      duration={5}
    >
      Hello World
    </HandwritingText>
  );
}

Using SVG File

import { HandwritingText } from 'react-cursive-handwrite';

function App() {
  return (
    <HandwritingText 
      svgFile="/path/to/your/cursive.svg"
      strokeColor="#0000FF"
    >
      Hello World
    </HandwritingText>
  );
}

As a Heading

import { HandwritingText } from 'react-cursive-handwrite';

function App() {
  return (
    <HandwritingText 
      fontPath="fonts/google"
      as="h1"
      strokeColor="#00FF00"
      strokeWidth={2}
    >
      Welcome to My Site
    </HandwritingText>
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | children | React.ReactNode | Required | The text to be displayed | | fontPath | string | "google" | Path to the directory containing letter SVG files | | path | string | - | SVG path data for the text (overrides fontPath) | | svgFile | string | - | Path to an SVG file containing the path data | | strokeColor | string | "#000" | Color of the stroke | | strokeWidth | number | 2 | Width of the stroke | | duration | number | 3 | Duration of the animation in seconds | | width | number \| string | "100%" | Width of the SVG viewport | | height | number \| string | "100%" | Height of the SVG viewport | | strokeDashArray | number | 2000 | Initial stroke dash array value | | as | ElementType | "div" | HTML element type to wrap the text | | replay | boolean | false | Whether to replay the animation | | replayDelay | number | 2000 | Delay in milliseconds before replaying the animation |

Creating Custom SVG Paths

You can create custom SVG paths for your text using various tools:

  1. FontForge: Convert fonts to SVG paths
  2. Adobe Illustrator: Create and export SVG paths
  3. Online SVG Path Generators: Convert text to SVG paths

Example SVG File Structure

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <path d="M 20,80 C 20,80 40,20 60,20 S 80,20 80,80 S 60,140 40,140 S 20,140 20,80"/>
</svg>

Best Practices

  1. Performance: For optimal performance, keep the SVG path data as simple as possible
  2. Responsiveness: Use percentage-based widths and heights for responsive designs
  3. Animation: Adjust the duration based on the length of the text
  4. Replay: Use the replay feature sparingly to avoid overwhelming users
  5. Font Files: Ensure your font SVG files are properly named (lowercase letters) and placed in the correct directory structure

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT

Support

If you find this package useful, please consider giving it a ⭐️ on GitHub!