WYSIWYG editor for teachers: Studio vs custom solution recommendations
I am working with a web app that needs to have good visual front-end editing options.
We really need to close in on perfect WYSIWYG.
This is an application for education. Students will log in and read topics. Teachers will be able to log in, read and edit live on complete lookalike version of the page.
I have questions like:• Should the editor be put inside of studio?
• What are the pros and cons using Sanity for this.
• Also, any recommendations on how i should proceed?
I am very thankful for perspectives.
😌
Yes, use Sanity Studio and add the Presentation Tool rather than building your own editor. Presentation loads your real student-facing site in an iframe inside Studio. Teachers see a live preview of their draft as they type, and can click any piece of content to jump to the field behind it. It isn't inline editing in the page itself: teachers type into Studio fields next to a live preview of the real page.
How it works
- Preview and editing side by side: edits show in the preview in real time. Hovering an element outlines it, and clicking it opens that document and field, even deep inside Portable Text (Presentation Tool user guide).
- Click-to-edit overlays: the Sanity client adds invisible "stega" metadata, based on Content Source Maps, to string values.
@sanity/visual-editingthen draws overlays over that content (overlays, client and stega). - Drag and drop: teachers can reorder array-based sections (for example a topic's
sections) directly in the preview (drag and drop). - Presentation is available on every plan (announcement).
Students never touch Studio. They read the published site. Only teachers need Studio accounts.
Setup outline (Next.js App Router)
Integration guides also exist for Nuxt, React Router, SvelteKit and Astro (Visual Editing).
- Add Presentation to Studio. It's included in the
sanitypackage. You no longer install a separate@sanity/presentationpackage.
// studio/sanity.config.ts
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {presentationTool} from 'sanity/presentation'
export default defineConfig({
projectId: 'YOUR_PROJECT_ID',
dataset: 'production',
plugins: [
structureTool(),
presentationTool({
previewUrl: {
initial: 'http://localhost:3000',
previewMode: {enable: '/api/draft-mode/enable'},
},
}),
],
})Add resolve with defineLocations and defineDocuments so documents map to routes, for example /topics/:slug (configuring Presentation).
- Configure the client with a Studio URL for stega:
// frontend/src/sanity/lib/client.ts
import {createClient} from 'next-sanity'
export const client = createClient({
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET,
apiVersion: '2026-02-01',
useCdn: true,
stega: {studioUrl: 'http://localhost:3333'},
})Add live content and overlays. Call
defineLivefromnext-sanity/livewith a Viewer token to getsanityFetchand<SanityLive />. Add a draft mode enable route. Render<VisualEditing />fromnext-sanity/visual-editingin your root layout when draft mode is on. Add your frontend as a CORS origin with credentials:npx sanity cors add http://localhost:3000 --credentials. The full walkthrough is in Visual Editing with Next.js App Router. If you're starting from scratch, use the Next.js quick start.Optional: enable drag and drop. Add
data-sanityattributes withcreateDataAttribute, and useuseOptimisticon the sections array. It needs Studio 3.65.0+,@sanity/visual-editing5.7.3+ (React 19.2+,@sanity/client7.24.0+). It works in Chrome 108+, Safari 15.6+, Firefox 115+ and Edge 126+, and doesn't work on touch devices yet (drag and drop).
Pros and cons
Pros
- You reuse your real frontend components for the preview, so it matches what students see.
- Content stays structured, so the same topics can feed other channels later.
- Teachers can't break the layout. Page building uses components your developers define.
- You get Studio's maintenance, features and plugin ecosystem without building a custom editor.
Cons
- Teachers edit in fields next to the preview, not inline on the page.
- It takes integration work: draft mode, stega, CORS and location resolvers.
- Rich text is Portable Text (structured JSON), not HTML. You render it with your own components. To change how the editor looks and behaves, see customizing the Portable Text Editor and Portable Text Editor plugins.
Other options
- If teachers write long-form material, Canvas offers a document-style writing space. Content is mapped to your schema with field labels and sent into Studio.
- You can still build a fully custom editor on Sanity's APIs, but you'd be building and maintaining the editing experience yourself.
Get a teacher to try the edit, preview and publish flow early, before you build out every content type.
Show original thread6 replies
Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.