diff --git a/src/content/editor/getting-started/install/svelte.mdx b/src/content/editor/getting-started/install/svelte.mdx index d2e7f8f0..87be6c8b 100644 --- a/src/content/editor/getting-started/install/svelte.mdx +++ b/src/content/editor/getting-started/install/svelte.mdx @@ -35,7 +35,7 @@ npm run dev Now that we're done with boilerplate, let's install Tiptap! For the following example you'll need the `@tiptap/core` package, with a few components, `@tiptap/pm`, and `@tiptap/starter-kit`, which includes the most common extensions to get started quickly. ```bash -npm install @tiptap/core @tiptap/pm @tiptap/starter-kit +npm install @tiptap/core @tiptap/pm @tiptap/starter-kit @tiptap/extension-bubble-menu ``` If you followed steps 1 and 2, you can now start your project with `npm run dev` and open [http://localhost:3000/](http://localhost:3000/) in your favorite browser. This might be different if you're working with an existing project. @@ -47,68 +47,71 @@ To start using Tiptap, you'll need to add a new component to your app. Let's cal This is the fastest way to get Tiptap up and running with SvelteKit. It will give you a very basic version of Tiptap, without any buttons. No worries, you will be able to add more functionality soon. ```svelte -import { Editor } from '@tiptap/core' - import { StarterKit } from '@tiptap/starter-kit' - import BubbleMenu from '@tiptap/extension-bubble-menu' - - let bubbleMenu = $state() - let element = $state() - let editorState = $state({editor: null}) - - onMount(() => { - editor = new Editor({ - element: element, - extensions: [ - StarterKit, - BubbleMenu.configure({ - element: bubbleMenu, - }), - ], - content: ` -
This editor is running in Svelte.
-Select some text to see the bubble menu popping up.
- `, - onTransaction: ({editor}) => { - // force re-render so `editor.isActive` works as expected - editorState = { editor } - }, +