Add an AI Rich Text Editor to Next.js in 3 Minutes (2026 Tutorial)
A step-by-step video tutorial: add the Eddyter AI rich text editor to a Next.js App Router project, with toolbar, slash commands, tables and AI writing, and keep the content as HTML in React state.
Your app needs a real editor: headings, tables, images and AI writing. Building one yourself takes months. In this tutorial you add Eddyter, an AI rich text editor, to a Next.js app in about three minutes, with the content kept in React state so you can save it anywhere.
What you will build
A Next.js rich text editor page built on the App Router: the full Eddyter toolbar, slash commands, tables and the AI menu. Every change arrives as HTML through onChange.
Code: github.com/EddyterAI/examples, tutorials/01-nextjs-quickstart
Before you start
- Node.js and npm (pnpm, yarn or bun also work)
- React 18.2 or newer, including React 19
- An Eddyter account. The Free plan has no time limit.
Step 1: Create the Next.js app
Start with a fresh app and accept the defaults. If you already have a Next.js app, skip to step 2.
Step 2: Install Eddyter and import the stylesheet
Import the stylesheet once, as high in the app as possible. In the App Router, that is the root layout. Without it, toolbars and tables will not render correctly.
Step 3: Get your API key
Sign in at eddyter.com, open License Keys in your dashboard and copy your key. Paste it into a .env.local file. Keep keys in environment variables and never commit them.
Step 4: Add the editor component
Create a component called Editor. Mark it 'use client', because the editor runs in the browser. Wrap the editor in EditorProvider, pass the default fonts and your current user (the comments feature uses it), then give the editor your API key, some starting content and an onChange handler.
onAuthSuccess and onAuthError tell you when the editor is ready, or why it is not.
Step 5: Put it on a page
Open http://localhost:3000. You will see the full Eddyter toolbar, slash commands, tables and the AI menu inside your app.
Step 6: Keep the content
Every change comes through onChange as HTML. In this tutorial it goes into React state, so you can save it to your database, send it to an API route or show a live preview. To load a saved document, pass it in as initialContent.
Recap
- Install the
eddyterpackage. - Import
eddyter/style.cssin the root layout. - Add your key to
.env.local. - Render the editor in a
'use client'component.
Next steps
- Eddyter documentation
- Quick install guide
- Full code for this tutorial on GitHub
- Next tutorial: version history, so your users can save and restore drafts.
Show the full transcriptHide the transcript
Your app needs a real editor: headings, tables, images, AI writing. Building one takes months. In the next few minutes, we'll add Eddyter to a Next.js app and have it running, with your content saved in state. Let's build it. Start with a fresh Next.js app. Run create-next-app, accept the defaults, and open the folder. If you already have an app, skip ahead to step two. Install the package with npm, or pnpm, yarn or bun. Eddyter works with React 18.2 and up, including React 19. Next, import the stylesheet once, as high in the app as possible. In the App Router, that's the root layout. Without it, toolbars and tables won't render correctly. The editor needs a license key. Sign in at eddyter.com, open License Keys in your dashboard, and copy your key. The Free plan has no time limit, and every paid plan has a free trial. Paste it into a .env.local file as NEXT_PUBLIC_EDITOR_API_KEY. Keep keys in environment variables, and never commit them. Create a component called Editor. Mark it 'use client', because the editor runs in the browser. Import three things from eddyter: the EditorProvider, the editor itself, and the default config. Wrap the editor in the provider and pass it the default fonts and your current user, which the comments feature uses. Then give the editor your API key, some starting content, and an onChange handler. onAuthSuccess and onAuthError tell you when it's ready, or why it isn't. Now use it. Import the Editor into your page and render it. Run the dev server and open localhost. There it is: the full Eddyter toolbar, slash commands, tables, and the AI menu, all inside your app. Every change comes through onChange as HTML. Here it goes into React state, so you can save it to your database, send it to an API route, or show a live preview. To load a saved document, pass it in as initialContent. That's it: install the package, import the stylesheet, add your key, and render the editor in a client component. The full code is linked below. Next time: version history, so your users can save and restore drafts. Find everything at eddyter.com.
How long does it take to add Eddyter to a Next.js app?
About three minutes for a basic setup: install the package, import the stylesheet, add your API key and render the editor in a client component.
Which React and Next.js versions does Eddyter support?
Eddyter works with React 18.2 and newer, including React 19. This tutorial uses the Next.js App Router.
Why does the editor component need 'use client'?
The editor runs in the browser, so in the Next.js App Router the component that renders it must be a client component.
Where do I import the Eddyter stylesheet?
Import eddyter/style.css once, as high in the app as possible. In the App Router that is app/layout.tsx. Without it, toolbars and tables will not render correctly.
Where do I get an Eddyter API key, and is there a free plan?
Sign in at eddyter.com and open License Keys in your dashboard. The Free plan has no time limit, and every paid plan has a free trial.
How do I save and load the editor content?
Every change arrives through onChange as HTML. Store it in state, your database or an API route. To load a saved document, pass it to the editor as initialContent.
IntegrationVideo guideIntegrate Eddyter in Less Than 10 Minutes: Step-by-StepLearn how to integrate Eddyter into your app in less than 10 minutes. Step-by-step 2026 guide for React, Next.js, and modern web apps. Real code, no fluff.
6:35IntegrationVideo guideAdd a Rich Text Editor to Your Blog in 10 Minutes (React & Next.js, 2026)Publish a blog post with a plain textarea, then republish the same post with a real editor. Formatting survives, images align, and the AI generates a header image without leaving the page. React, Next.js, Vue and Angular — about 10 minutes of setup.
Getting startedVideo guideWhat is Eddyter? The AI Editor Developers Switch To (2026)What is Eddyter? A modern AI-powered rich text editor built for developers. Install in 3 steps, skip the infrastructure, and ship faster. Full 2026 guide inside.