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

swalekh-react

v2.1.6

Published

![npm](https://img.shields.io/npm/v/swalekh-react) ![license](https://img.shields.io/npm/l/swalekh-react)

Downloads

31

Readme

Swalekh React Components

npm license

React components for integrating Swalekh input tools with centralized configuration management.

🔡 Swalekh React Example

This repository demonstrates how to integrate swalekh-react with Next.js and Vite.js applications.

👉 swalekh-react example on GitHub


🧩 What is swalekh-react?

A React wrapper for integrating the Swalekh transliteration engine with support for:

  • Phonetic typing in multiple Indian languages
  • Input elements like <textarea>, <input>, and <div contentEditable>

Features

  • 📝 Multiple input types: Input, Textarea, Div-based editor
  • 🌐 Centralized configuration management
  • 🔄 Dynamic language/theme switching
  • 🔧 Customizable per-component settings

Installation

  1. Install the package:
npm install swalekh-react
  1. Add Swalekh script to your HTML head:
<script src="https://swalekh.reverieinc.com/server/swalekh.js"></script>
  1. Validation key

Get the validation key from the Swalekh Developers Portal

const validation key = <'SWALEKH-VALIDATION-KEY'>

Basic Usage

import { SwalekhConfigProvider, SwalekhInput, SwalekhTextarea } from 'swalekh-react';

function App() {
  return (
    <SwalekhConfigProvider
      validationKey="YOUR_VALIDATION_KEY"
      language="hi"
      mode="phonetic"
      theme="light"
    >
      <SwalekhInput id="user-name" />
      <SwalekhTextarea id="user-bio" />
    </SwalekhConfigProvider>
  );
}

Configuration

Global Configuration Provider

<SwalekhConfigProvider
  validationKey="8f3b6ece-cf27-46f9-bfaf-5113c062c372"
  language="bn" // Bengali
  mode="phonetic"
  domain="1"
  theme="dark"
>
  {/* Your components */}
</SwalekhConfigProvider>

| Prop | Required | Default | Description | |----------------|----------|-------------|-------------------------------| | validationKey| Yes | - | API validation key | | language | No | "en" | Input language code | | mode | No | "phonetic"| Input method | | domain | No | "1" | Application domain | | theme | No | "light" | UI theme (light/dark) |

Dynamic Configuration Updates

Change settings at runtime using the useSwalekhConfig hook.

function SwalkekhConfigure() {
  const { setConfig } = useSwalekhConfig();

  return (
    <div>
      <label>
        Language:
        <select
          onChange={(e) =>
            setConfig((c) => ({ ...c, language: e.target.value }))
          }
        >
          <option value="hi">Hindi</option>
          <option value="or">Odia</option>
          <option value="bn">Bengali</option>
          <option value="gu">Gujarati</option>
          <option value="ta">Tamil</option>
        </select>
      </label>
      <label>
        Mode:
        <select
          onChange={(e) => setConfig((c) => ({ ...c, mode: e.target.value }))}
        >
          <option value="phonetic">Phonetic</option>
          <option value="keyboard">Keyboard</option>
        </select>
      </label>
    </div>
  );
}

Component Props

All components support these props (override global config):

| Prop | Default | Description | |----------------|--------------------|--------------------------------------| | id | "swalekhInput" | Unique DOM ID | | className | "" | Additional CSS classes | | language | "en" | Set individual component language |

Troubleshooting

1. Script Not Found Warning

  • Ensure the Swalekh script is loaded before components mount
  • Check for ad blockers interfering with the script

2. Configuration Not Applying

  • Verify components are inside SwalekhConfigProvider
  • Check for conflicting prop names

3. Build Errors

rm -rf node_modules && npm install
npm run build

Swalekh Products

Contact

If you need help or want to contribute, reach out through any of the following: