Skip to main content

Contentstack Visual Editor: What Not to Build

Not every field needs to be clickable. Learn where to focus Contentstack Visual Editor effort and avoid the Draft Mode mistakes that break previews.

Rodrigo Peplau, Brazil Country Head, 4 December 2026

A smiling woman in glasses clasps her hands while looking at a laptop in an office.

I’ve lost count of how many content management systems I’ve shipped in my career. Of my twenty-six years in the industry, sixteen have been spent in the same corner: building digital marketing solutions for teams who need their websites to move as fast as their campaigns do. On every one of those platforms, I’ve run into the same feature under a different name. Sometimes it’s a page builder, sometimes an experience editor. In Contentstack, it’s the Visual Editor. 

The name changes. The promise doesn’t: an editor opens a page, clicks on what they see, changes it and watches it update live. No developer standing over their shoulder, no ticket queue, no waiting for a deploy. We used to call this WYSIWYG, back when the acronym still felt futuristic. Today it’s table stakes. Every serious CMS and DXP has some version of it, and every year that version gets more sophisticated. 

Contentstack is no exception. Between Live Preview and the Visual Editor, content editors can compose entire pages and configure components directly on the rendered screen, which I call the visual canvas. This article is for technical leads and digital leaders planning or running a Contentstack build. It covers where to spend engineering effort, what to skip to keep build and testing costs down, and the setup mistakes that quietly break previews. It’s built around one rule of thumb I’ve carried from platform to platform: 

Everything should be editable from the same page editing interface. 

Not most things. Everything. Every time an editor has to abandon the visual canvas and dig through a complex content form, the flow breaks. You remind them they’re wrestling with software instead of building a page. The objective is to keep editors in that visual flow for as long as possible. 

That’s the goal. Getting there is where most teams learn some things the hard way. 

Start from a position of strength 

If there’s one piece of advice, I’d give any team picking up Contentstack for the first time, it’s this: don’t build your Live Preview infrastructure from scratch. Start from a proven foundation. 

Contentstack’s own Kickstart for Next.js comes with preview and editable tags already wired up. At MSQ DX, as a Contentstack Elite partner, we build on Basecamp, our in-house foundation for Next.js sites on Contentstack, which adds caching, targeted content refresh and typed queries. 

That matters because getting the Visual Editor to work at all requires two things configured correctly and in sync: the preview setup (which lives partly in your code and partly in your Contentstack project settings) and a set of special tags, called CSLP tags, attached to the elements in your components that editors need to click. 

Miss either half and nothing works. The Kickstart gives you both out of the box, along with the plumbing for pulling entries and passing them into your components. If you’re starting fresh, this is your shortcut past an entire category of early mistakes. 

The myth I had to unlearn: “everything editable” doesn’t mean “everything inline” 

This is the part that changed how my team thinks about building for the Visual Editor, and I suspect it will do the same for yours. 

When we first heard “your site needs to fully support the Visual Editor,” a member of my team and I made the same assumption: every field on every component, no exceptions, needs to be clickable and editable directly on the canvas, also known as inline editing. That felt like the literal reading of “100% editable.” It also felt like a lot of work for marginal value. 

Take an optional description field. In a normal React component, an empty field doesn’t render an empty paragraph tag. It renders nothing. That’s disciplined frontend engineering, but it creates an odd problem for a visual editor: there’s no element on the page to click. How does an editor turn on a field that, by design, doesn’t exist yet? 

We assumed the answer had to be clever conditional rendering, such as showing an empty placeholder box whenever the site is viewed inside the Visual Editor, so there’s always something to click. It’s a solvable problem. It’s also, as it turns out, an unnecessary one. 

Contentstack’s own guidance cuts through this: you don’t need a special view for these cases. The sidebar form, the panel that lists every field on the entry including optional ones that aren’t currently rendered, already lets an editor add that value. The moment they do, the field appears on the page and is inline-editable like everything else. The form and the visual canvas aren’t competitors. They’re one connected editing experience. 

Why does this matter? Engineering every component to detect and handle its own “editor mode” isn’t free. It means a second version of every component’s behavior, new Storybook stories and new tests. You’ve quietly doubled the testing surface of your component library to save an editor one extra click into a sidebar. That’s rarely a good trade. 

On a recent build, we left optional fields in the sidebar form instead of building editor-mode variants of each component, which kept our test suite from doubling. 

The rule I now build by: default to the form for anything conditional or optional. Reserve true inline editing for what naturally renders. You hit the 100% editability goal either way, on the more maintainable path. 

When your component won’t sit still 

A second edge case breaks the “just use the sidebar” solution: components that move on their own. 

Picture a hero section that cycles automatically between two states every few seconds, purely on a timer. Try to inline-edit that in a visual editor and you’ll understand the problem immediately: the target you’re trying to click keeps disappearing out from under your cursor. 

Can a component tell, at runtime, whether it’s inside the Visual Editor rather than on the published site? Yes. Whenever a page opens in preview or the Visual Editor, Contentstack appends preview parameters to the URL, and your code can read them. Use that signal to pause an animation, freeze a carousel or reveal a hidden field the moment a component knows an editor is looking. 

The catch is the same as before. The moment you write an if statement to make a component behave differently in the Visual Editor, you’ve created a second behavioral path that needs its own tests, stories and maintenance. Contentstack doesn’t require it, and I wouldn’t reach for it as a default. Save it for cases like a runaway animation, where the alternative doesn’t work, and plan for the extra testing. 

The quiet problem underneath: making sure editors see draft content 

Everything above assumes the editor sees the draft, not the last published version wearing a live-editing overlay. That holds for free if your Next.js site renders server-side on every request. It doesn’t if your site relies on static generation or ISR for performance, which is why many teams pick Next.js in the first place. 

If you’re on SSR, skip ahead: standard SSR Live Preview works without any of what follows. If you’re on SSG or ISR, Next.js Draft Mode stands between “editor clicks Preview” and “editor sees the draft.” It lets you bypass the static cache on demand instead of standing up a separate draft environment. 

Here’s how the three pieces chain together: 

Diagram: Contentstack Live Preview sends parameters to a Next.js draft route, which sets cookies to select the Preview or Delivery API.

Live Preview Architecture

Live Preview appends preview parameters to a request against a Draft API route. The route enables Next.js Draft Mode and forwards the parameters as cookies. Server components or getStaticProps read those cookies and choose between the Preview API and the Delivery API. 

Two lessons from getting this wrong. 

First, the Preview-versus-Delivery switch behaves differently depending on where your code runs. On the client, the SDK reads the relevant parameters from the browser and switches automatically. On the server, it has no such visibility, so you hand the parameters to the SDK explicitly through livePreviewQuery(). Whenever you do that server-side, create a fresh SDK instance per request. The call mutates internal state on the instance, so sharing it across requests, as in a typical singleton pattern, risks one user’s preview session leaking into someone else’s page load. It’s a subtle bug and an ugly one to debug after the fact. 

Second, cookies. Live Preview runs inside an iframe, so Draft Mode cookies only travel on that cross-site request if they are set to SameSite=None; Secure. Next.js does this in production, but uses SameSite=Lax in local development. The result is a confusing split: preview works on a deployed environment but can fail silently on a developer’s machine, where the editor sees the published page and assumes the Visual Editor is broken. There is also a security trade-off. SameSite=None lets the cookie be sent in cross-site contexts, so ideally you would apply it only to editor sessions. That scoping isn’t automatic in our setup today, so plan for it if your security team asks. 

Get both right and the draft content problem is solved. What’s left is a smaller, more visible wrinkle caused by the same handshake. 

One known wrinkle 

Not everything here is frictionless. On first load, an editor using Draft Mode sees a notification bar and clicks through it once before the preview renders correctly. It’s caused by how the redirect chain in Draft Mode’s cookie handshake interacts with the iframe: the iframe doesn’t follow that first redirect on its own. 

There is no automated fix today, and I’d rather tell you now than have you discover it mid-project and wonder if you did something wrong. 

If that extra click is a dealbreaker for your editorial team, and for some teams it is, there’s a clean way out: skip Draft Mode and use standard SSR Live Preview. It needs no Draft API route, no cookie handling and no notification bar, and it works across both the App Router and the Pages Router. It’s the option I’d point any SSR-based team toward. 

Where this leaves us 

If you take one thing from this article, let it be this: “100% visually editable” is a goal about the editor’s experience, not a mandate that every field must be clickable on the canvas itself. 

Hit that goal by using the sidebar form for anything conditional or hidden, reserving inline editing for what naturally renders, and reaching for editor-detection logic only when a component’s own behavior, like an animation, leaves you no other option. Get your infrastructure right by starting from Contentstack’s Kickstart instead of building preview from scratch, treating the SDK instance-per-request rule as non-negotiable and checking how your Draft Mode cookies behave across environments, a small detail that trips up more teams than it should. 

Sixteen years in, this is still the part of the job I find truly satisfying: taking a platform’s promises and working out where the real engineering effort needs to go, and where it doesn’t. I hope this saves you some of the detours it took me to get here. 

Is your Contentstack build giving editors the control they need without inflating your testing? If you want a second opinion, reach out to our experts at msqdx.com/us/contact. 

Frequently asked questions 

What is the Contentstack Visual Editor? 

The Contentstack Visual Editor lets editors open a page, click on what they see, change it and watch it update live, with no developer, ticket queue or deploy. It works alongside Live Preview and relies on CSLP tags attached to the elements editors need to click. 

Does every field need to be editable directly on the page in the Contentstack Visual Editor? 

No. “100% editable” is a goal about the editor’s experience, not a requirement that every field be clickable on the page. Conditional and optional fields can stay in the sidebar form. Once an editor adds a value there, the field renders and becomes inline-editable like any other. 

What are CSLP tags in Contentstack? 

CSLP tags are special tags attached to the elements in your components that editors need to click in the Visual Editor. They work with the preview setup, which lives partly in your code and partly in your Contentstack project settings. If either is missing, the Visual Editor does not work. Contentstack’s Kickstart for Next.js includes both. 

Do you need Next.js Draft Mode to use Contentstack Live Preview? 

Only if your Next.js site uses static generation (SSG) or incremental static regeneration (ISR). Draft Mode bypasses the static cache on demand so editors see the draft. Server-side rendered sites can use standard SSR Live Preview, which needs no Draft API route or cookie handling. 

Why does Draft Mode show the published page instead of the draft in Contentstack Live Preview? 

Live Preview runs inside an iframe, so Draft Mode cookies reach the page only if they are SameSite=None; Secure. Next.js sets them that way in production but uses SameSite=Lax in local development, so preview can fail silently on a developer’s machine. If an editor sees the published page, check the cookies in your browser’s developer tools. 

Person wearing black shoes standing on a yellow circle painted on a gray, speckled concrete floor.

NEWSLETTER _

Expert Insights

Get expert insights on digital transformation, customer experience, and commercial impact delivered to your inbox.

SIGN UP

Related articles _

Tap into our latest thinking to discover the newest trends, innovations, and opinions direct from our team.