百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

ngx-tiptap

> 前端框架
开源

tiptap 的 Angular 绑定

200 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

tiptap 的 Angular 绑定

NgxTiptap

Angular bindings for Tiptap 3 demo on stackblitz | edit stackblitz

Find a example on how to use the editor here at project/demo directory.

Installation

bash
npm i ngx-tiptap

# or

yarn add ngx-tiptap

[!NOTE] This package just provides the bindings for angular. For configuring/customizing the editor, refer tiptap's official documentation.

For any issues with the editor. You may need to open the issue on tiptap's repository

Usage

All components are now standalone. Import the component you need.

Create an instance of the editor

…

and in HTML

xml

[!NOTE] No styling is provided by default. You are in full control of how your editor looks. Refer tiptaps's styling guide for more information.

[!TIP] Since the editor is dynamically created, You may need to set ViewEncapsulation to None or target the class/element via ::ng-deep to apply the styles. See Component Styles docs for more info.

Options

  • outputFormat [json or html] - defaults to html.

You can get the json or html format from the editor directly as well.

Refer https://www.tiptap.dev/guide/output#export

Extensions

Refer: https://www.tiptap.dev/api/extensions

Floating Menu

This will make a contextual menu appear near a selection of text. The markup and styling are totally up to you.

Import the TiptapFloatingMenuDirective to your component and use it. For example:

xml

  

Refer: https://www.tiptap.dev/api/extensions/floating-menu

Bubble Menu

This will make a contextual menu appear near a selection of text. Use it to let users apply marks to their text selection. The markup and styling are totally up to you.

Import the TiptapBubbleMenuDirective to your component and use it. For example:

xml

  

Refer: https://www.tiptap.dev/api/extensions/bubble-menu

AngularNodeViewRenderer

This enables rendering Angular Components as NodeViews.

Create a Node Extension

…

Refer: https://tiptap.dev/guide/custom-extensions

Create a Component

typescript
import { Component } from '@angular/core';
import { AngularNodeViewComponent } from 'ngx-tiptap';

@Component({
  selector: 'app-nodeview-counter',
})
export class NodeviewCounterComponent extends AngularNodeViewComponent {
  increment(): void {
    const updateAttributes = this.updateAttributes();

    updateAttributes({
      count: this.node.attrs.count + 1,
    });
  }
}

Use the extension

…

Access/Update Attributes

Refer https://www.tiptap.dev/guide/node-views/react/#all-available-props for the list of all available attributes. You can access them by extending the AngularNodeViewComponent

typescript
import { AngularNodeViewComponent } from 'ngx-tiptap';

export class NodeviewCounterComponent extends AngularNodeViewComponent {
  increment(): void {
    const updateAttributes = this.updateAttributes();

    updateAttributes({
      count: this.node.attrs.count + 1,
    });
  }
}

Adding a content editable

There is another directive called tiptapNodeViewContent which helps you adding editable content to your node view. Make sure to import the TiptapNodeViewContentDirective to your component.

Here is an example.

xml

Refer: https://www.tiptap.dev/guide/node-views/react/#adding-a-content-editable

Dragging

To make your node views draggable, import the TiptapDraggableDirective to your component and set draggable: true in the tiptap extension. Add tiptapDraggable directive to the DOM element inside the component that should function as the drag handle.

AngularRenderer

You can also manually render the angular components using AngularRenderer.

typescript
import { AngularRenderer } from 'ngx-tiptap';

const renderer = new AngularRenderer(Component, injector, props);

renderer.instance; // get the instance of the component, can be used to update `@Input` properties
renderer.dom; // get the HTMLElement for the component
renderer.destroy(); // destroy the component and its instance

Contributing

All types of contributions are welcome. See CONTRIBUTING.md to get started.

Issues· 12 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptangular-tiptapngx-tiptaptiptap-editortiptap-v2

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架