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

@kkeyboard/react

v0.3.15

Published

One-command React Khmer smart input plus headless bindings for KKeyboard

Readme

@kkeyboard/react

This package provides a batteries-included React input plus a framework-neutral hook and compact suggestion UI. It does not depend on shadcn or any application design system.

Fastest integration

Install one package:

npm install @kkeyboard/react

Then use the ready-made input. It downloads the published Khmer runtime once, caches it in the browser, and reuses it on later visits (including offline visits when the browser cache is available):

import { useState } from "react";
import { KKeyboardInput } from "@kkeyboard/react";
import "@kkeyboard/react/styles.css";

export function KhmerInput() {
  const [value, setValue] = useState("");

  return (
    <KKeyboardInput
      value={value}
      onChange={(event) => setValue(event.target.value)}
      placeholder="វាយជាខ្មែរ ឬ khnom"
      aria-label="Khmer text"
    />
  );
}

KKeyboardInput keeps normal Space as a normal visible space when the user keeps their own spelling. Press Enter, Tab, a number key, or click a candidate to accept a suggestion; accepted words use the invisible boundary needed for Khmer word deletion. Current-word completion is enabled by default, while next-word prediction is opt-in:

<KKeyboardInput
  nextWordSuggestionsEnabled
  mode="auto"
  register="auto"
  value={value}
  onChange={(event) => setValue(event.target.value)}
/>

For Next.js, place the component in a client component ("use client"). No Tiptap package or network service is required for this ready-made textarea. The first runtime load is local to the browser; the engine does not send typed text to a server.

Custom engine or advanced hosts

Pass an engine to avoid loading the bundled runtime, or use the lower-level hook when integrating with Tiptap, a custom editor, or another design system.

import { useMemo } from "react";
import {
  KKeyboardSuggestionPopover,
  useKKeyboard,
} from "@kkeyboard/react";
import "@kkeyboard/react/styles.css";
import { createTiptapInputAdapter } from "@kkeyboard/tiptap";

const adapter = useMemo(
  () => createTiptapInputAdapter(editor),
  [editor],
);
const keyboard = useKKeyboard({ engine, adapter });

return (
  <KKeyboardSuggestionPopover
    view={keyboard.view}
    onSelect={(item) => (
      keyboard.view.query
        ? keyboard.commitCandidate(item)
        : keyboard.commitNextWord(item.text)
    )}
  />
);
import { useMemo } from "react";
import {
  KKeyboardSuggestionPopover,
  useKKeyboard,
} from "@kkeyboard/react";
import "@kkeyboard/react/styles.css";
import { createTiptapInputAdapter } from "@kkeyboard/tiptap";

const adapter = useMemo(
  () => createTiptapInputAdapter(editor),
  [editor],
);
const keyboard = useKKeyboard({ engine, adapter });

return (
  <KKeyboardSuggestionPopover
    view={keyboard.view}
    onSelect={(item) => (
      keyboard.view.query
        ? keyboard.commitCandidate(item)
        : keyboard.commitNextWord(item.text)
    )}
  />
);

The hook manages controller creation, editor event subscription, keyboard cleanup, and suggestion state. The host remains responsible for positioning the popover beside the editor caret.

Next-word prediction is disabled unless the host explicitly enables it through nextWordSuggestionsEnabled or getInputSettings.