Rtecn

Registry

Install rtecn packages via the shadcn registry.

shadcn Registry

Rtecn packages are available as a shadcn registry, allowing you to install the source code directly into your project using the shadcn CLI. This is the recommended way to install rtecn packages — it copies the editor source straight into your project so you have full control over styling and behavior, rather than depending on a published node_modules package.

If you'd rather install from npm instead, see npm vs registry below for the tradeoffs.

Setup

Add the rtecn registry to your components.json:

{
  "$schema": "https://ui.shadcn.com/schema/registry.json",
  "registries": {
    "@rtecn": "https://rtecn.space/r/{name}.json"
  }
}

Available packages

PackageCommand
@rtecn/editornpx shadcn@latest add @rtecn/editor
@rtecn/block-editornpx shadcn@latest add @rtecn/block-editor

Usage

After installation, the editor source files are in your project at components/rte-editor/ (or components/rte-block-editor/ for the block editor).

1. Import styles

Import the editor styles alongside your shadcn globals:

// Your shadcn globals
import "@/app/globals.css";

// Editor styles
import "@/components/rte-editor/style.css";

For the block editor:

import "@/components/rte-block-editor/style.css";

2. Install peer dependencies

The @tiptap/* packages are peer dependencies. The shadcn CLI will prompt you to install any it detects as missing, but you can also add them yourself:

npm install @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link @tiptap/extension-underline
yarn add @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link @tiptap/extension-underline
pnpm add @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link @tiptap/extension-underline
bun add @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link @tiptap/extension-underline

See the Editor or Block Editor docs for the full list of extensions.

3. Use the components

Rich text editor:

"use client";

import { useEditor } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import Placeholder from "@tiptap/extension-placeholder";
import { RichTextEditor, Link } from "@/components/rte-editor";

function MyEditor() {
  const editor = useEditor({
    immediatelyRender: false,
    extensions: [
      StarterKit,
      Link,
      Placeholder.configure({ placeholder: "Start typing..." }),
    ],
  });

  return (
    <RichTextEditor editor={editor}>
      <RichTextEditor.Toolbar sticky>
        <RichTextEditor.ControlsGroup>
          <RichTextEditor.Bold />
          <RichTextEditor.Italic />
          <RichTextEditor.Underline />
        </RichTextEditor.ControlsGroup>
      </RichTextEditor.Toolbar>
      <RichTextEditor.Content />
    </RichTextEditor>
  );
}

Block editor:

"use client";

import { useEditor } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import Placeholder from "@tiptap/extension-placeholder";
import {
  BlockEditor,
  SlashCommand,
  defaultSlashCommandItems,
  getSlashCommandSuggestion,
} from "@/components/rte-block-editor";

function MyBlockEditor() {
  const editor = useEditor({
    immediatelyRender: false,
    extensions: [
      StarterKit.configure({ heading: { levels: [1, 2, 3] } }),
      Placeholder.configure({ placeholder: "Type / for commands..." }),
      SlashCommand.configure({
        suggestion: getSlashCommandSuggestion(defaultSlashCommandItems),
      }),
    ],
  });

  return <BlockEditor editor={editor} />;
}

For the full API reference, props, and customization options, see the Editor and Block Editor pages.

How it works

The registry is served as static JSON files from https://rtecn.space/r/:

  • registry.json — catalog listing all available packages with metadata
  • editor.json — item schema for the toolbar editor (18 files, 17 dependencies)
  • block-editor.json — item schema for the block editor (19 files, 26 dependencies)

When you run shadcn add @rtecn/editor, the CLI:

  1. Fetches https://rtecn.space/r/editor.json
  2. Reads the files array to know which source files to install
  3. Copies each file's content into your project at the configured paths
  4. Installs all dependencies into your project

npm vs registry

npmRegistry (recommended)
Install locationnode_modulesYour project source
CustomizableNo (published dist)Yes (edit the source)
VersioningSemver via npmLatest from source
Peer dependency handlingManual installCLI prompts for missing ones
Use caseQuick setup, no source edits neededFull control over styling and behavior

Use the registry unless you have a specific reason to prefer a versioned npm dependency (for example, pinning to an exact release in a monorepo with strict dependency management).

Source

The registry is built from the same source as the npm packages. See scripts/build-registry.mjs for the build script.

On this page