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

tiptap-editor-components

v1.0.3

Published

Tiptap Editor and InlineEditor components for React

Downloads

347

Readme

Tiptap Editor Components

A simple npm package providing two Tiptap editor components: Editor and InlineEditor for React applications.

🚀 Demo

View the demo:

  • Open index.html in your browser (works standalone with CDN)
  • Or clone the repository and open example-react.html after building
  • Install the package: npm install tiptap-editor-components

Installation

npm install tiptap-editor-components

Peer Dependencies

Make sure you have these installed in your project:

npm install react react-dom @tiptap/core @tiptap/react @tiptap/starter-kit

Usage

Editor Component

The Editor component provides a full-featured rich text editor with all StarterKit extensions.

import React, { useState } from 'react';
import { Editor } from 'tiptap-editor-components';
import 'tiptap-editor-components/dist/styles.css'; // Optional: import default styles

function App() {
  const [content, setContent] = useState('<p>Hello World!</p>');

  return (
    <Editor
      content={content}
      onChange={(html) => setContent(html)}
      placeholder="Start typing..."
      editable={true}
      className="my-custom-class"
    />
  );
}

InlineEditor Component

The InlineEditor component is optimized for inline editing with block-level elements disabled.

import React, { useState } from 'react';
import { InlineEditor } from 'tiptap-editor-components';
import 'tiptap-editor-components/dist/styles.css'; // Optional: import default styles

function App() {
  const [content, setContent] = useState('<p>Click to edit</p>');

  return (
    <div>
      <h1>Title: </h1>
      <InlineEditor
        content={content}
        onChange={(html) => setContent(html)}
        placeholder="Enter text..."
        editable={true}
      />
    </div>
  );
}

Props

Both components accept the following props:

| Prop | Type | Default | Description | |------|------|---------|-------------| | content | string | '' | Initial HTML content | | onChange | (html: string) => void | undefined | Callback fired when content changes | | placeholder | string | 'Start typing...' | Placeholder text when editor is empty | | editable | boolean | true | Whether the editor is editable | | className | string | '' | Additional CSS class names | | extensions | Extension[] | [] | Additional Tiptap extensions |

Custom Extensions

You can add custom Tiptap extensions:

import { Editor } from 'tiptap-editor-components';
import { Link } from '@tiptap/extension-link';
import { Image } from '@tiptap/extension-image';

function App() {
  return (
    <Editor
      content="<p>Hello World!</p>"
      extensions={[
        Link.configure({
          openOnClick: false,
        }),
        Image,
      ]}
    />
  );
}

Styling

The package includes default styles that you can import:

import 'tiptap-editor-components/dist/styles.css';

You can also override styles using the className prop or by targeting the CSS classes:

  • .tiptap-editor - Main editor container
  • .tiptap-inline-editor - Inline editor container
  • .ProseMirror - ProseMirror editor content

Examples

Check out the example files in this repository:

  • example-react.html - Visual demonstration and usage examples (open in browser after building)
  • example.html - Interactive example (requires package to be built)

To view examples locally:

  1. Build the package: npm run build
  2. Open example-react.html in your browser

Quick Start Example:

import { Editor, InlineEditor } from 'tiptap-editor-components';
import 'tiptap-editor-components/dist/styles.css';

Development

# Install dependencies
npm install

# Build the package
npm run build

# Watch mode for development
npm run dev

License

MIT