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 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-penstroke

v1.0.0

Published

A lightweight React component that highlights text with a smooth, hand-drawn marker effect. Perfect for emphasizing content like a real pen stroke in a book.

Downloads

251

Readme

React-Penstroke

A lightweight React component that highlights text with a smooth, hand-drawn marker effect. Perfect for emphasizing content like a real pen stroke in a book.

npm version npm downloads License: MIT

Installation

npm install react-penstroke
# or
yarn add react-penstroke
# or
pnpm add react-penstroke

Usage

import React from 'react';
import { PenStroke } from 'react-penstroke';

function Example() {
  return (
    <div>
      <h1>
        This is <PenStroke>highlighted text</PenStroke> with a pen stroke effect.
      </h1>
      
      <p>
        You can <PenStroke color="#ff9800" thickness={8} roughness={5}>customize</PenStroke> the appearance.
      </p>

      <h3>Styles</h3>
      <p>
        <PenStroke underline>Underline style</PenStroke> instead of highlight.
      </p>
      <p>
        <PenStroke behind>Highlight behind text</PenStroke> (great for dark mode).
      </p>
      <p>
        <PenStroke strokeIndex={0}>Specific stroke style</PenStroke> or <PenStroke strokeIndex="random">random style</PenStroke>.
      </p>
      <p>
        <PenStroke animate>Animated stroke</PenStroke> or <PenStroke hover animate>animate on hover</PenStroke>.
      </p>
    </div>
  );
}

Props

| Prop | Type | Default | Description | |-------------|--------------------|------------|----------------------------------------------------------------| | children | React.ReactNode | (required) | The text to highlight | | color | string | '#ffeb3b' | The highlight color | | opacity | number | 0.5 | The opacity of the highlight (0-1) | | thickness | number | 6 | The thickness of the highlight (1-25) | | roughness | number | 3 | The roughness of the highlight edge (1-10) | | behind | boolean | false | Whether to place the highlight behind the text | | underline | boolean | false | Whether the stroke should be under the text (underline effect) | | strokeIndex | number | "random" | 1 | Index of the stroke style to use, or "random" | | width | string | number | '100%' | The width of the stroke relative to the text | | animate | boolean | false | Whether to animate the stroke drawing | | hover | boolean | false | Whether to show the stroke only on hover | | className | string | '' | Additional CSS class names | | style | React.CSSProperties| {} | Additional inline styles |

Features

  • 🎨 Customizable highlight color, opacity, thickness, and roughness
  • 📝 Natural-looking marker-style effect
  • 🌟 Works with any text length or element
  • 📦 Small bundle size with no external dependencies
  • 🔧 TypeScript support with full type definitions

License

MIT © Ziv Reich