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

pk-editor

v3.2.1

Published

A modern rich text editor component for React with active state indicators, keyboard shortcuts, word count, and fullscreen mode

Readme

PK Editor

npm version npm downloads bundle size license

A modern, lightweight rich text editor component for React with intuitive design and powerful features.

🚀 Live Demo

Try it now →

✨ Features

  • 🎨 Modern UI - Clean, professional interface with intuitive icons
  • ⌨️ Keyboard Shortcuts - Standard shortcuts (Ctrl+B, Ctrl+I, Ctrl+U, etc.)
  • 🔄 Active States - Visual feedback showing current formatting
  • 📊 Word Count - Real-time word and character counting
  • 🖥️ Fullscreen Mode - Distraction-free editing experience
  • 📱 Responsive - Works seamlessly on desktop, tablet, and mobile
  • 🎯 Lightweight - Only 29KB unpacked, zero dependencies
  • 🔧 Easy Integration - Simple props, works with any React app

🚀 Quick Start

Installation

npm install pk-editor

Basic Usage

import React, { useState } from 'react';
import { PKEditor } from 'pk-editor';

function App() {
  const [content, setContent] = useState('<p>Start typing...</p>');

  return (
    <div>
      <PKEditor 
        value={content} 
        onChange={setContent} 
      />
    </div>
  );
}

📖 API Reference

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | string | undefined | HTML content of the editor | | onChange | function | undefined | Callback fired when content changes |

Example with all props

<PKEditor
  value={htmlContent}
  onChange={(newContent) => setHtmlContent(newContent)}
/>

🛠️ Features Overview

Text Formatting

  • Bold (Ctrl+B)
  • Italic (Ctrl+I)
  • Underline (Ctrl+U)
  • Strikethrough
  • Subscript (H₂O)
  • Superscript (E=mc²)

Block Formatting

  • Headings (H1-H6)
  • Paragraph
  • Blockquote
  • Code Block

Lists

  • Bullet Lists
  • Numbered Lists

Styling

  • Font Size (8pt - 36pt)
  • Text Color
  • Highlight Color
  • Text Alignment (Left, Center, Right)
  • Indentation

Media & Links

  • Insert Links (Ctrl+K)
  • Remove Links
  • Insert Images
  • Insert Tables

Actions

  • Undo (Ctrl+Z)
  • Redo (Ctrl+Y)
  • Clear Formatting
  • Fullscreen Mode (Esc to exit)

🎯 Advanced Usage

Controlled Component

import React, { useState, useEffect } from 'react';
import { PKEditor } from 'pk-editor';

function AdvancedEditor() {
  const [content, setContent] = useState('');
  const [wordCount, setWordCount] = useState(0);

  const handleContentChange = (newContent) => {
    setContent(newContent);
    
    // Extract text for word counting
    const text = newContent.replace(/<[^>]*>/g, '');
    setWordCount(text.trim().split(/\s+/).length);
  };

  return (
    <div>
      <PKEditor 
        value={content}
        onChange={handleContentChange}
      />
      <div>Words: {wordCount}</div>
    </div>
  );
}

Form Integration

import React, { useState } from 'react';
import { PKEditor } from 'pk-editor';

function BlogForm() {
  const [formData, setFormData] = useState({
    title: '',
    content: '<p>Write your blog post...</p>'
  });

  const handleSubmit = (e) => {
    e.preventDefault();
    console.log('Blog post:', formData);
  };

  return (
    <form onSubmit={handleSubmit}>
      <input
        type="text"
        placeholder="Blog title"
        value={formData.title}
        onChange={(e) => setFormData({
          ...formData,
          title: e.target.value
        })}
      />
      
      <PKEditor
        value={formData.content}
        onChange={(content) => setFormData({
          ...formData,
          content
        })}
      />
      
      <button type="submit">Publish</button>
    </form>
  );
}

🎨 Styling

The editor comes with beautiful default styles, but you can customize it:

/* Override editor container */
.rte-container {
  border: 2px solid #your-color;
  border-radius: 12px;
}

/* Customize toolbar */
.rte-toolbar {
  background: #your-background;
}

/* Style editor area */
.rte-editor {
  font-family: 'Your Font', sans-serif;
  font-size: 18px;
}

⌨️ Keyboard Shortcuts

| Shortcut | Action | |----------|--------| | Ctrl+B | Bold | | Ctrl+I | Italic | | Ctrl+U | Underline | | Ctrl+Z | Undo | | Ctrl+Y | Redo | | Ctrl+K | Insert Link | | Esc | Exit Fullscreen |

🌟 Why Choose PK Editor?

vs TinyMCE

  • Lighter - 29KB vs 500KB+
  • No licensing - Completely free
  • Modern React - Built specifically for React

vs Quill

  • Better icons - More intuitive visual design
  • Active states - Clear visual feedback
  • Fullscreen mode - Built-in distraction-free editing

vs Draft.js

  • Simpler API - Just value and onChange
  • HTML output - No complex state management
  • Ready to use - No additional setup required

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT © Tauqeer Abbas

🔗 Links


Made with ❤️ by Tauqeer Abbas