Next.js
Run the init command to create a new Next.js project or to setup an existing one:
npx @tiptap/cli@latest initChoose between a Next.js project or a Monorepo.
When prompted with:
Would you like to add a template or UI components to your project?Select UI Components if you want to include reusable Tiptap UI components. Alternatively, select Template to scaffold a full example project.
Only add styles
If you added a template or UI components during setup, you can skip this section and proceed directly to Add Styles.
Add Tiptap components
Install Tiptap UI components using the CLI. For example, to add the HeadingButton component:
npx @tiptap/cli@latest add heading-buttonThe command above will install the HeadingButton component and its dependencies. You can then import and use it in your Tiptap project:
import { HeadingButton } from '@/components/ui/heading-button' export default function App() { // Tiptap ... return ( <> <HeadingButton level={1}>Heading 1</HeadingButton> <HeadingButton level={2}>Heading 2</HeadingButton> <HeadingButton level={3}>Heading 3</HeadingButton> </> ) }Add Styles
Bun projects automatically convert SCSS to CSS
If you’re using Bun, the CLI automatically converts all .scss files into .css files during installation. This means your imports should use .css instead of .scss, for example:
@import './styles/_variables.css';
@import './styles/_keyframe-animations.css';
Import the global SCSS styles in the main stylesheet:
File: src/index.css
@import './styles/_variables.scss'; @import './styles/_keyframe-animations.scss';Learn more about configuring styles in the style setup guide.