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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ileaf-text-editor

v1.0.6

Published

A React-based rich text editor library with Quill.js, featuring PDF/DOCX export, print support, and extensive customization options

Readme

iLeaf Text Editor

A React-based rich text editor library built with Quill.js, featuring export capabilities to PDF and DOCX formats.

Features

  • 🖊️ Rich text editing with Quill.js
  • 📄 Export to PDF and DOCX formats
  • 🎨 Tailwind CSS styling
  • 📱 Responsive design
  • 🔧 Customizable components
  • ⚡ Built with Vite for optimal performance

Installation

npm install ileaf-text-editor

Usage

Basic Usage

import { TextEditor } from "ileaf-text-editor";
import "ileaf-text-editor/index.css";

function App() {
  return (
    <div>
      <TextEditor />
    </div>
  );
}

Advanced Usage with Props

import { TextEditor } from "ileaf-text-editor";
import "ileaf-text-editor/style.css";

function App() {
  const handleContentChange = (content) => {
    console.log("Content changed:", content);
  };

  return (
    <TextEditor
      initialContent="<p>Welcome to the editor!</p>"
      onChange={handleContentChange}
      logo="/custom-logo.svg"
      logoWidth="50px"
      logoHeight="50px"
      showExportMenu={true}
      showPreview={true}
      className="custom-editor-class"
    />
  );
}

Split View Mode (Editor + Preview)

import { TextEditor } from "ileaf-text-editor";
import "ileaf-text-editor/style.css";

function SplitViewEditor() {
  return (
    <TextEditor
      initialContent="<p>Type here and see the preview on the right!</p>"
      showPreview={true}
      showExportMenu={true}
    />
  );
}

Editor Only Mode (Default)

import { TextEditor } from "ileaf-text-editor";
import "ileaf-text-editor/style.css";

function EditorOnlyMode() {
  return (
    <TextEditor
      initialContent="<p>Full-width editor mode</p>"
      showPreview={false} // This is the default
      showExportMenu={true}
    />
  );
}

Custom Logo Sizes

import { TextEditor } from "ileaf-text-editor";
import "ileaf-text-editor/style.css";

function CustomLogoSizes() {
  return (
    <div>
      {/* Small logo */}
      <TextEditor
        logo="/logo.svg"
        logoWidth="24px"
        logoHeight="24px"
        initialContent="<p>Small logo example</p>"
      />

      {/* Large logo */}
      <TextEditor
        logo="/logo.svg"
        logoWidth="60px"
        logoHeight="60px"
        initialContent="<p>Large logo example</p>"
      />

      {/* Custom aspect ratio */}
      <TextEditor
        logo="/wide-logo.svg"
        logoWidth="80px"
        logoHeight="30px"
        initialContent="<p>Wide logo example</p>"
      />
    </div>
  );
}

Using Individual Components

import { EditorPane, PreviewPane, ExportMenu } from "ileaf-text-editor";
import "ileaf-text-editor/style.css";

function CustomEditor() {
  return (
    <div>
      <ExportMenu />
      <EditorPane content="<p>Hello World</p>" onChange={() => {}} />
      <PreviewPane content="<p>Hello World</p>" />
    </div>
  );
}

API Reference

TextEditor Props

| Prop | Type | Default | Description | | ---------------- | ---------- | ----------------------------------------------------------------------------------------- | ----------------------------------- | | initialContent | string | "<p>Your starting content...</p>" | Initial HTML content for the editor | | meta | object | { caseName: "Case XYZ", personName: "Jane Doe", date: new Date().toLocaleDateString() } | Metadata for export documents | | logo | string | "/logo.png" | Logo URL for export documents | | logoWidth | string | "40px" | Logo width (CSS value) | | logoHeight | string | "40px" | Logo height (CSS value) | | onChange | function | undefined | Callback fired when content changes | | className | string | "" | Additional CSS classes | | showExportMenu | boolean | true | Whether to show the export menu | | showPreview | boolean | false | Whether to show the preview pane |

Available Components

  • TextEditor - Complete text editor with all features
  • EditorPane - Just the editor component
  • PreviewPane - Preview component for rendered content
  • SplitView - Split view layout component
  • ExportMenu - Export functionality menu

Utility Functions

  • exportDoc - Export content as DOCX
  • exportPdf - Export content as PDF

Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build library
npm run build

# Lint code
npm run lint

Dependencies

  • React 18+
  • Quill.js
  • Tailwind CSS
  • jsPDF
  • html-docx-ts
  • file-saver

License

MIT

Contributing

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

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.