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

customise-text-editor

v1.1.0

Published

A highly customizable, production-ready Rich Text Editor for React, powered by Tiptap.

Readme

💎 Customise-Text-Editor

NPM Version License: MIT Bundle Size

A highly customizable, production-ready Rich Text Editor for React, built on the solid foundation of Tiptap.


✨ Features at a Glance

| Feature | Description | | :--- | :--- | | 🎨 Premium UI | Modern, sleek design with smooth transitions and glassmorphism support. | | 🔢 Real-time Stats | Automatic footer with character counting when maxLength is enabled. | | 📝 Dual Output | Seamlessly switch between HTML and clean Plain Text exports. | | 🔗 Hooks-First | First-class support for react-hook-form via standard Controller APIs. | | 💅 Total Control | Custom width, alignment, margins, and branding-specific themes. | | ⚡ Ultra-Light | Meticulously optimized bundle (only ~11KB) with zero bloated dependencies. |


📦 Installation

Get started in seconds:

npm install customise-text-editor

[!IMPORTANT] Since this is a library, ensure you import the CSS in your main entry file (e.g., App.tsx or main.tsx) to enable the premium aesthetics.

import 'customise-text-editor/style.css';

🚀 Quick Start

Creating a powerful editor has never been easier:

import { CustomEditor } from 'customise-text-editor';
import 'customise-text-editor/style.css';

function App() {
  const handleSave = (content) => {
    console.log('Editor Content:', content);
  };

  return (
    <div className="container">
      <CustomEditor 
        config={{
          width: '800px',
          align: 'center',
          placeholder: 'Start writing your story...',
          maxLength: 1000, 
          outputFormat: 'html',
          onChange: handleSave,
          theme: {
            primaryColor: '#6366f1',
            borderRadius: '12px'
          }
        }} 
      />
    </div>
  );
}

🏗️ Advanced Integration: React Hook Form

We built this editor with form libraries in mind. It integrates perfectly with Controller and validation rules.

import { useForm, Controller } from 'react-hook-form';
import { CustomEditor } from 'customise-text-editor';

const BlogEditor = () => {
  const { control, handleSubmit, formState: { errors } } = useForm({
    defaultValues: { postContent: '' }
  });

  const onSubmit = (data) => console.log('Payload:', data);

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <Controller
        name="postContent"
        control={control}
        rules={{ 
          required: 'Please write something before publishing',
          minLength: { value: 50, message: 'Your post is too short (min 50 chars)' }
        }}
        render={({ field }) => (
          <CustomEditor
            config={{
              initialContent: field.value,
              onChange: (val) => field.onChange(val),
              maxLength: 5000,
              placeholder: 'Write your masterpiece...'
            }}
          />
        )}
      />
      {errors.postContent && <p className="error">{errors.postContent.message}</p>}
      <button type="submit">Publish Masterpiece</button>
    </form>
  );
};

📑 Detailed API Configuration

EditorConfig Props

| Prop | Type | Default | Description | | :--- | :--- | :--- | :--- | | width | string \| number | '100%' | Width of the editor (e.g., '800px', '100%'). | | align | 'left' \| 'center' \| 'right' | 'left' | Alignment of the editor container. | | outputFormat | 'html' \| 'text' | 'html' | Content format sent to the onChange callback. | | maxLength | number | - | Character limit. Enables the live-counter footer auto-magically. | | placeholder | string | 'Write here...' | Placeholder text when the editor is empty. | | theme | ThemeConfig | - | Custom theme object for colors and styling (see below). | | features | string[] | All | Array of enabled toolbar features (bold, italic, etc.). |

ThemeConfig Options

{
  primaryColor: string;    // Accent color for icons & progress
  borderRadius: string;   // Control the "roundness" (e.g., '16px')
  backgroundColor: string; // Background of the editor area
  textColor: string;       // Color of the content text
}

🛠️ Troubleshooting: Vite Configuration

If you encounter issues like "Outdated Optimize Dep" or React version mismatches while using this package, you must add the following aliases to your consumer project's vite.config.ts. This ensures that both your project and the editor use the same instance of React.

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      'react': path.resolve(__dirname, 'node_modules/react'),
      'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
    },
  },
});

📄 License

Proudly open-source under the MIT License. Created by kanhaiya-dct.