Files
tiptap/docs/src/docPages/guide/getting-started.md
2020-12-03 16:52:54 +01:00

1.5 KiB
Raw Blame History

Getting started

toc

Introduction

tiptap 2 is framework-agnostic and even works with plain JavaScript, if thats your thing. Were working on guides for all the different frameworks and workflows, but here is the general one. The following steps should help you to integrate tiptap in your JavaScript project.

Alternative Guides

Requirements

  • Node installed on your machine

1. Install the dependencies

For the following example youll need the @tiptap/core (the actual editor) and the @tiptap/starter-kit which has everything to get started quickly, for example a few default extensions.

# install with npm
npm install @tiptap/core @tiptap/starter-kit

# install with Yarn
yarn add @tiptap/core @tiptap/starter-kit

2. Add a container

You need a place somewhere in your app, where we should place tiptap. Place the following HTML there:

<div class="element"></div>

3. Initialize the editor

Now, lets initialize the editor in JavaScript:

import { Editor } from '@tiptap/core'
import { defaultExtensions } from '@tiptap/starter-kit'

new Editor({
  element: document.querySelector('.element'),
  extensions: defaultExtensions(),
  content: '<p>Your content.</p>',
})

When you open the project in your browser, you should now see tiptap in action. Time to give yourself a pat on the back. Lets start to configure your editor in the next step.