18
packages/ui/src/RichEditor/RichEditor.tsx
Normal file
18
packages/ui/src/RichEditor/RichEditor.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { EditorContent, useEditor } from "@tiptap/react";
|
||||
import { BubbleMenu, FloatingMenu } from "@tiptap/react/menus";
|
||||
import { StarterKit } from "@tiptap/starter-kit";
|
||||
|
||||
export const RichEditor = () => {
|
||||
const editor = useEditor({
|
||||
extensions: [StarterKit], // define your extension array
|
||||
content: "<p>Hello World!</p>", // initial content
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<EditorContent editor={editor} />
|
||||
<FloatingMenu editor={editor}>This is the floating menu</FloatingMenu>
|
||||
<BubbleMenu editor={editor}>This is the bubble menu</BubbleMenu>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user