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

@tiptap-block-kit/react

v0.0.4

Published

Custom component extension kit for Tiptap (React)

Readme

⚛️ @tiptap-block-kit/react

React bindings for tiptap-block-kit.

Build and manage custom Tiptap components using React with a simple, registry-based API.


📦 Installation

npm install @tiptap-block-kit/react

🚀 Quick Start

import { useEditor, EditorContent } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import {
  createRegistry,
  defineComponent,
  CustomComponentKit,
} from "@tiptap-block-kit/react";

const Badge = defineComponent({
  name: "badge",
  component: CustomComponent,
});

const registry = createRegistry([Badge]);

export default function App() {
  const editor = useEditor({
    extensions: [
      StarterKit,
      CustomComponentKit.configure({
        registry,
      }),
    ],
  });
  return <EditorContent editor={editor} />;
}

🧱 Define a Component

const Badge = ({ label }: { label: string }) => {
  return <span>{label}</span>;
};

const Badge = defineComponent({
  name: "badge",
  component: Badge,
});

⚡ Insert Component

editor.commands.insertComponent({
  id: "badge-1",
  componentName: "badge",
  props: {
    label: "Hello",
  },
});

🎢 insertRawComponent

insertRawComponent lets you insert a custom component without using a registry or defineComponent.

editor.commands.insertRawComponent({
  id: "raw__1",
  componentName: "raw",
  component: Raw,
  props: {
    content: "unregistered component",
  },
});

⚠️ Notes

  1. If a component with the same componentName exists in the registry, the registry component takes precedence.
  2. Rendering is not guaranteed after reload or rehydration (e.g. when using setContent or external JSON).

Description

This command allows you to quickly insert a custom component at runtime without any prior setup.

It is useful for simple or experimental use cases where setting up a registry is unnecessary.

Type safety for component props is still preserved at compile time.


🔄 Update Component

editor.commands.updateComponentPropsById("badge-1", {
  label: "Updated",
});

❌ Remove Component

editor.commands.removeComponentById("badge-1");


🔍 Get Components

// Returns all custom components currently in the editor
editor.getCustomComponents();

🧠 Concepts

Component

A unit of UI defined with defineComponent.

Registry

A collection of components used by the editor.

Props

Serializable data passed to the component.


✅ Compatibility

  • @tiptap/core → v2 & v3
  • @tiptap/react → v2 & v3
  • react → v18 & v19

⚙️ Advanced

CustomComponentKit.configure(options)

Configure the behavior of the custom component system.

Options


Name Type Required Description


registry ComponentRegistry Yes Storage of registered custom components

fallback (info: { componentName: No Fallback renderer when an unknown string; props: AnyProps component is encountered }) => HTMLElement | (e.g. setContent). Insert-time ReactNode unknowns are ignored

baseExtensionName string No Base node type name. Default is "customComponent"



editor.commands.insertComponent(options)

Insert a custom component into the editor.

Options


Name Type Required Description


id string Yes Unique identifier for the component instance

componentName string Yes Name of the registered component

props Record<string, No Props passed to the component unknown>

profile "block" | No Rendering mode. Default is "block" "blockDraggable" |
"inline" |
"inlineDraggable"

ensureEditableSpace boolean No Ensures enough editable space to prevent insertion failure or blocked typing (default: true)



Profiles

Defines how the component behaves inside the editor.

  • block
  • blockDraggable
  • inline
  • inlineDraggable

Draggable Components

Draggable profiles only add attributes.
To enable actual dragging, include a data-drag-handle attribute in your component.

function CustomCard({
  title,
  description,
}: {
  title: string;
  description?: string;
}) {
  return (
    <div data-drag-handle>
      <h3 style={{ margin: 0 }}>{title}</h3>
      {description && (
        <p style={{ marginTop: 8, marginBottom: 0 }}>{description}</p>
      )}
    </div>
  );
}

Why

The library does not automatically inject data-drag-handle to avoid interfering with UI/UX.

Tiptap is a headless editor, so interaction and styling should remain under user control.

📄 License

MIT