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

accio-react-text-editor

v1.0.4

Published

A powerful, feature-rich React component library for building rich text editors with built-in speech-to-text capabilities, smart mention support, and flexible feature toggles.

Readme

Speech-to-Text Rich Text Editor

A powerful, feature-rich React component library for building rich text editors with built-in speech-to-text capabilities, smart mention support, and flexible feature toggles.

Features

Speech-to-Text Integration

  • Built-in Web Speech API integration
  • Real-time transcript display
  • Seamless text insertion from voice input

🎯 Smart @Mentions

  • Custom mention autocomplete
  • User selection from suggestions
  • Styled mention tags with hover effects

⚙️ Feature Toggles

  • Enable/disable features dynamically
  • No need to rebuild
  • Granular control over functionality

📝 Rich Text Editing

  • Built on Quill editor
  • Multiple formatting options
  • Undo/redo support

🎨 Customizable Styling

  • Dark mode support
  • Tailwind CSS ready
  • Easy theme customization

Installation

npm install speech-to-text-editor
# or
yarn add speech-to-text-editor

Quick Start

import { RichTextEditor } from "speech-to-text-editor";
import "speech-to-text-editor/styles";

export default function MyEditor() {
  const editorRef = useRef(null);

  return (
    <RichTextEditor
      ref={editorRef}
      placeholder="Start typing or use the microphone..."
      features={{
        speechToText: true,
        mentions: true,
        formatting: true,
      }}
      onContentChange={(content) => {
        console.log("HTML:", content.html);
        console.log("JSON:", content.content);
      }}
    />
  );
}

API Reference

RichTextEditor Component

Main editor component with all features integrated.

Props

| Prop | Type | Default | Description | | ------------------ | ---------- | ------------------- | ----------------------------- | | placeholder | string | "Start typing..." | Editor placeholder text | | features | object | All enabled | Feature configuration | | onContentChange | function | - | Callback when content changes | | mentions | array | [] | Available mentions list | | onMentionTrigger | function | - | Callback when @ is typed | | className | string | "" | CSS class name | | style | object | {} | Inline styles | | readOnly | boolean | false | Read-only mode |

Ref Methods

const editorRef = useRef(null);

// Get HTML content
editorRef.current.getHTML();

// Insert text
editorRef.current.insertText("Hello World");

// Control speech
editorRef.current.startSpeech();
editorRef.current.stopSpeech();

// Selection
editorRef.current.getSelection();
editorRef.current.setSelection(0, 10);

// Get Quill instance
editorRef.current.getQuill();

useEditor Hook

Manage a Quill editor instance.

const {
  editorRef,
  quillRef,
  isReady,
  getContent,
  getHTML,
  setContent,
  setHTML,
  insertText,
  insertEmbed,
  getSelection,
  setSelection,
} = useEditor(options);

useSpeechRecognition Hook

Handle Web Speech API interactions.

const {
  isListening,
  transcript,
  interimTranscript,
  error,
  isSupported,
  startListening,
  stopListening,
  abortListening,
  resetTranscript,
} = useSpeechRecognition(options);

useFeatureToggle Hook

Manage feature toggles dynamically.

const { features, toggleFeature, setFeature, isEnabled } = useFeatureToggle({
  speechToText: true,
  mentions: true,
});

Feature Configuration

Control which features are enabled:

<RichTextEditor
  features={{
    speechToText: true, // Enable voice input
    mentions: true, // Enable @mentions
    formatting: true, // Enable text formatting
    undo: true, // Enable undo
    redo: true, // Enable redo
  }}
/>

Handling Mentions

const handleMentionTrigger = ({ index, text }) => {
  // Show mention suggestions
  // User selects: @Alice
};

<RichTextEditor
  onMentionTrigger={handleMentionTrigger}
  mentions={[
    { id: "1", label: "Alice Johnson" },
    { id: "2", label: "Bob Smith" },
  ]}
/>;

Content Management

const editorRef = useRef(null);

const handleDownload = () => {
  const html = editorRef.current.getHTML();
  // Download or send to server
};

const handleClear = () => {
  const quill = editorRef.current.getQuill();
  quill.setContents([]);
};

Browser Support

  • Chrome/Edge: Full support including Web Speech API
  • Firefox: Full support (requires feature flag)
  • Safari: Full support (iOS 14.5+)
  • Mobile: Full support with native speech recognition

Styling

The editor comes with default styles. Customize with CSS:

/* Override speech button color */
.speech-btn {
  background-color: #007bff;
}

/* Customize mention styling */
.mention-span {
  background-color: #e0e7ff;
  color: #3730a3;
}

Advanced Usage

Custom Toolbar

<RichTextEditor
  modules={{
    toolbar: [
      ["bold", "italic", "underline"],
      [{ list: "ordered" }, { list: "bullet" }],
      ["link", "image"],
    ],
  }}
/>

Content Persistence

const [content, setContent] = useState(null);

const saveContent = async () => {
  const html = editorRef.current.getHTML();
  await fetch("/api/save", {
    method: "POST",
    body: JSON.stringify({ content: html }),
  });
};

<RichTextEditor onContentChange={(c) => setContent(c)} />;

Examples

See the demo app for complete working examples including:

  • Basic editor setup
  • Feature toggle implementation
  • Mention selection UI
  • Content preview and export
  • HTML download functionality

License

MIT © 2025

Contributing

Contributions welcome! Please open issues and submit pull requests.

Support

For issues, questions, or feature requests, please visit our GitHub repository.