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-word-spell-checker

v1.0.8

Published

A customizable React input wrapper for real-time spell checking using nspell. Works offline with no external API required.

Readme

react-word-spell-checker

🧠 A lightweight, fully customizable React component for real-time word spell checking using nspell. Works offline – no API required.

npm MIT License React


✨ Features

  • 🔍 Real-time spell checking while typing
  • ✅ Fully offline (uses local Hunspell dictionary files)
  • 🧩 Customizable dropdown rendering
  • 💬 Works with <textarea> or <input>
  • 📦 Easy to integrate into any React app

📦 Installation

npm install react-word-spell-checker
# or
yarn add react-word-spell-checker

🚀 Usage

Use SpellCheckerWrapper to wrap any controlled input or textarea and enable real-time spell checking:

import { useState } from "react";
import { SpellCheckerWrapper } from "react-word-spell-checker";

function App() {
  const [text, setText] = useState("");

  return (
    <div style={{ maxWidth: 600, margin: "2rem auto" }}>
      <SpellCheckerWrapper value={text} onChange={setText}>
        <textarea placeholder="Type here..." />
      </SpellCheckerWrapper>
    </div>
  );
}

🎨 Custom Dropdown (Optional)

Customize the suggestion dropdown by providing a renderDropdown prop:

<SpellCheckerWrapper
  value={text}
  onChange={setText}
  renderDropdown={(suggestions, onSelect) => (
    <ul
      style={{
        background: "#fff",
        border: "1px solid #ccc",
        padding: 0,
        listStyle: "none",
      }}
    >
      {suggestions.map((s) => (
        <li
          key={s}
          onClick={() => onSelect(s)}
          style={{ padding: "8px", cursor: "pointer" }}
        >
          🔠 {s}
        </li>
      ))}
    </ul>
  )}
>
  <textarea />
</SpellCheckerWrapper>

🔧 Props

| Prop | Type | Description | | ----------------- | -------------------------------------------------- | -------------------------------------------- | | value | string | Controlled value for the input or textarea | | onChange | (val: string) => void | Callback when the text changes | | children | ReactElement | The actual <textarea> or <input> element | | className | string | Optional class name for the wrapper div | | renderDropdown | (suggestions: string[], select: fn) => ReactNode | Optional function to customize dropdown UI | | suggestionLimit | number | Max number of suggestions (default: 10) |


📁 How It Works

  • 📚 Loads local Hunspell .aff and .dic dictionary files using Vite’s ?raw import
  • 🧠 Uses nspell to check spelling and suggest corrections
  • 🔄 Monitors the last word typed for accuracy and displays suggestions
  • 🔌 Works 100% offline — no backend or API calls

🛠 Built With


🧪 Local Development & Testing

To test your package locally in another app:

npm run build
npm pack
# You'll get: react-word-spell-checker-1.0.0.tgz

# In another React app:
npm install /path/to/react-word-spell-checker-1.0.0.tgz

🧾 License

MIT © Muhammad Muzammil