Visual editor
Edit text, images, styles and sections in the page preview. Apply changes, use inline AI and restore edits with undo.
Open the visual editor on a desktop or tablet to change text, images and styles in the private draft preview. Manual controls work without a provider key. AI edits and generated sections need a configured built-in AI provider.
Applied page and asset changes stay in the draft until publication.
Activating the editor
Click the Edit button in the preview toolbar (above the live preview). The preview iframe enters editing mode:
- Hovering over any editable element shows a blue highlight
- Clicking an element selects it and opens a context toolbar
- The page is live - scroll, resize, and interact normally
Click Edit again to deactivate.
While the editor is active, all controls outside the preview are disabled and dimmed - the top navigation, status bar, and conversation panel. Only the Edit toggle stays interactive, preventing accidental navigation or state changes while you're editing.
What you can do
Edit text inline
Select any text element (heading, paragraph, button label, link) and click the Edit action in the toolbar. The text becomes editable right where it is, and a formatting toolbar appears above the element.
Type your changes, use Enter for line breaks, and format text with the toolbar or keyboard shortcuts. When you're done, click Apply (or press ⌘↵) to save your changes - a brief saving animation confirms the write. Click Cancel (or press Esc) to revert the element to its original content.
Formatting text
The formatting toolbar offers three controls:
| Button | Shortcut | What it does |
|---|---|---|
| B | ⌘B | Bold the selected text |
| I | ⌘I | Italicize the selected text |
| 🔗 | ⌘K | Wrap the selected text in a link |
The toolbar tracks the element - if it grows taller as you type, the toolbar follows. Formatting buttons highlight when the cursor is inside formatted text.
When inserting or editing a link, a dedicated modal appears with the URL field, an optional Link Style dropdown (populated from existing link classes on the page), and an Open in new window checkbox. The modal is draggable and shows contextual titles - "Insert Link" for new links, "Edit Link" when the cursor is inside an existing link.
If an element contains PHP template syntax (<?php, <?=), the toolbar shows a "PHP detected" hint instead of formatting buttons. Use the Code Editor for those elements.
Swap images
Select an image and click the Image action. VoxelSite opens the asset picker so you can choose a replacement from your uploaded images. The toolbar hides while the picker is open and reappears if you cancel. After selecting an image, the element deselects for a clean state.
Edit styles
Select any element and click the Style action to open the style editor panel. The panel uses icon-based navigation to organize style controls into tabs:
| Tab | Controls |
|---|---|
| Typography | Font size, weight, alignment, letter spacing, line height, transform, decoration |
| Spacing | Padding and margin values |
| Colors | Text color, background color, border color |
| Layout | Width, display, flex/grid settings |
| Borders | Border width, radius, style |
| Effects | Box shadow, opacity |
| Classes | Direct class input and management |
Supported style changes preview through the browser JIT CSS engine without a server request.
Edit with AI
Select any element and click the AI button in the toolbar. A prompt panel appears centered above the element where you can describe changes in plain language:
- "Make this section warmer with earth tones"
- "Add a third testimonial card"
- "Change this to a two-column layout"
- "Rewrite the heading to state the service and location"
The panel title shows the element you're editing (e.g., "Edit Section" or "Edit Heading"). Type your instructions - press Enter for new lines, ⌘↵ (Ctrl+Enter) to submit. The textarea auto-grows as you type.
When you submit, the panel closes and the entire Studio enters a generating state - the same full-page overlay used by the code editor's inline AI:
- A centred status card appears over a backdrop, blocking all Studio interaction
- The card shows a live timer, current step, token count, and a Stop button
- Inside the preview, the selected element dims with a gentle opacity pulse and animated amber hatch lines
Press Escape or click Stop to cancel the generation. The AI rewrites the section in the source file, and the preview reloads automatically with the result.
The panel is draggable - grab the grip icon in the header to reposition it. If you select a different element or deselect, the panel closes automatically.
Delete elements
Select any element and click the Delete action. A confirmation dialog appears before the element is permanently removed from the source.
Edit source code
Select any element and click the Source (<>) button in the toolbar. An inline Monaco editor appears directly over the element, showing the raw HTML source - including any PHP code (<?php, <?=).
This is useful when you need precise control over attributes, structure, or embedded PHP expressions that the visual controls don't cover.
How it works
- VoxelSite fetches the actual source file and extracts the exact fragment for this element using the internal address system
- The source text appears in a syntax-highlighted editor with line numbers
- Edit the HTML directly - add attributes, restructure nested elements, modify PHP expressions
- Click Apply (or press ⌘S) to save, or Cancel (or press Esc) to discard
Validation
The editor validates your HTML as you type:
- Tag balance - every opening tag must have a matching closing tag in the correct order. Misnested tags like
<div><span></div></span>are caught immediately - Missing closing brackets - a
<div class="foo"without a closing>is flagged - Dangerous content -
<script>,<iframe>, and inlineon*=event handlers are blocked - Root element - the source must contain one top-level element with the same tag name
When a check fails, Apply is disabled and the editor shows an error with its line number. These checks do not execute PHP or prove the rendered page works. Review the preview after applying.
Pessimistic save
The source editor saves defensively:
- Your change is written to the source file first
- Only after the file save succeeds does the live preview update
- If the source changed elsewhere, the save is refused. Keep your text, refresh the source and review the differences before retrying
Both text edits and source edits save defensively: the file is written first, and the preview updates only after the write succeeds.
Add sections
Between every section on your page, a small + button appears at the section boundary. Click it to open the section picker.
Choosing a section type
The picker presents a grid of section types, each with an icon and a brief description:
| Type | What it adds |
|---|---|
| Hero | Large banner with heading, subheading, and call-to-action |
| Content | Flexible content block with text, images, or mixed media |
| Features | Grid of feature or benefit cards |
| Gallery | Image grid or masonry layout |
| Testimonials | Customer quotes and reviews |
| FAQ | Frequently asked questions, typically with accordions |
| Team | Team member cards with photos and bios |
| Pricing | Pricing table with plan comparison |
| Contact | Contact form with details and map |
| CTA | Call-to-action banner to drive conversions |
| Stats | Key numbers and metrics |
| Footer | Footer with links, contact info, and social media |
Adding instructions
After selecting a section type, an optional instruction field appears. You can leave it empty (the AI will generate appropriate content for your business), or provide specific direction:
- "3 team members with short bios"
- "5 questions about shipping and returns"
- "pricing for Basic, Pro, and Enterprise plans"
Click Generate to start. The AI creates the section to match your site's existing design language - same fonts, colors, spacing rhythm, and Tailwind patterns.
What happens during generation
A full-page overlay appears - the same design used by the code editor's inline AI and the visual editor's AI edit - with live progress:
- Preparing - the AI reads your site context
- Generating - the status card shows elapsed time, token count, and a Stop button (e.g., "Generating FAQ… 12s · 1,250 tokens")
- Done - the page reloads, scrolls to the new section, and highlights it with a brief blue outline
Press Escape or click Stop to cancel generation at any time.
Generation time depends on the model and requested change.
Where sections are inserted
The section is inserted exactly where you clicked the + button:
- Click the + at the very top → the new section appears before your first section
- Click the + between the hero and content sections → the new section appears between them
- Click the + after the last section → the new section appears at the end
Move sections
Each section divider also shows ▲ and ▼ chevron buttons for reordering sections. These buttons appear when you hover a divider and control the section directly above that divider.
| Button | What it does |
|---|---|
| ▲ | Moves the section above this divider up - swaps it with the section before it |
| ▼ | Moves the section above this divider down - swaps it with the section after it |
The preview moves the section without an AI request, then saves the new order to the source file. Check the save result.
After a move, the page scrolls to follow the section to its new position. The divider below the moved section shows the appropriate buttons to undo the move or continue in either direction.
Visual feedback
When you hover a section divider, a diagonal-hatching overlay appears over the section that divider controls. This makes it immediately clear which section the ▲ and ▼ buttons refer to.
The first divider at the very top of the page is labeled top and has no chevrons - it only contains the + button for inserting a new section before the first one.
The style panel
Icon-based navigation
The style panel uses a row of small SVG icons instead of text tabs. This keeps the panel compact and lets you jump between categories quickly. The active tab is highlighted.
Color picker
The color picker displays 17 Tailwind color families in a scrollable grid:
- Choose the property - Switch between Text, Background, and Border using the segmented control at the top
- Special colors - White, black, and transparent appear above the matrix
- Pick a color - The scrollable matrix shows all 17 color families × 11 shades (50-950). Four rows are visible at a time; scroll to see more. The active color cell is highlighted with a white border indicator
When reopening the color tab, the matrix auto-scrolls to reveal the currently active color. Scroll position is preserved when clicking colors, so the matrix stays in place.
Live preview
Supported changes in the style panel preview on the page. The original classes are preserved until you explicitly click Apply & Compile. If you close the panel without applying or click Reset, all preview changes are reverted.
Responsive breakpoints
Your website looks different on a phone than it does on a desktop monitor. The style panel edits breakpoint-specific utility classes using the breakpoint bar - a row of buttons between the tab icons and the style controls:
[ Base ] [ sm ] [ md ] [ lg ] [ xl ] [ 2xl ]
Each button represents a screen-size range:
| Breakpoint | Screen width | Think of it as… |
|---|---|---|
| Base | All screens (default) | Mobile-first starting point |
| sm | ≥ 640px | Large phones in landscape |
| md | ≥ 768px | Tablets |
| lg | ≥ 1024px | Small laptops |
| xl | ≥ 1280px | Desktops |
| 2xl | ≥ 1536px | Large monitors |
How it works
-
Select a breakpoint - Click a button in the bar. All controls in the style panel now show and edit styles only for that screen size.
-
Make your change - For example, set the font size to
4xlwhilelgis selected. This means "on large screens and up, use size 4xl" - smaller screens are not affected. -
Check other breakpoints - Click Base to see what mobile visitors get, then click lg to see the desktop version. Each breakpoint is independent.
The dot indicator
When a breakpoint button shows a small amber dot (●), it means the selected element already has styles set specifically for that screen size. This makes it easy to see at a glance which breakpoints have been customized.
How styles cascade
Styles work from small to large - a style set at Base applies to all screen sizes unless a larger breakpoint overrides it. For example:
- Base =
text-lg→ all screens show large text - md =
text-2xl→ tablets and larger show extra-large text instead - xl =
text-4xl→ desktops show even bigger text
You don't need to set every breakpoint. Only set the ones where you want the style to change.
Practical tips
- Start with Base - Design for mobile first, then add overrides at larger breakpoints
- Watch the dot - If a heading looks wrong on desktop but fine on mobile, check which breakpoints have dots - the override is there
- Use the Classes tab - Switch to the Classes tab to see the raw class names (like
md:text-2xl). This can help you understand exactly what is applied at each breakpoint
Apply & Compile
When you click Apply & Compile, VoxelSite:
- Updates the element's
classattribute in the source PHP file - Triggers a Tailwind CSS recompile to include any new utility classes
- Reloads the preview CSS so the compiled styles take effect
The saved draft page uses the new classes and compiled stylesheet. The published copies remain unchanged until publication.
JIT CSS preview
VoxelSite includes a Just-In-Time CSS engine that runs entirely in the browser. When you toggle a Tailwind class in the style panel, the JIT engine generates a supported CSS rule in the browser and inserts it into the preview.
The JIT engine supports:
- Typography - font sizes, weights, tracking, leading, transforms, decorations
- Colors - 22 Tailwind color families × 11 shades for text, background and border. The picker exposes 17 families; the Classes tab can use supported class names
- Spacing - padding and margin for all sides, using the full Tailwind spacing scale
- Layout - width, max-width, display, flex direction, alignment, gap
- Borders - border width, radius, style
- Effects - box shadows, opacity
- Responsive prefixes - all of the above work with breakpoint prefixes (
sm:,md:,lg:,xl:,2xl:)
When you apply your changes, VoxelSite compiles the final Tailwind CSS on the server. Check the applied result after the preview reloads.
The draggable panel
The style panel can be dragged anywhere on screen using the grip icon (⋮⋮) in the header. This lets you position it wherever is most convenient while editing.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
V |
Toggle visual editor on/off |
⌘B |
Bold (while editing text) |
⌘I |
Italic (while editing text) |
⌘K |
Insert link (while editing text) |
⌘↵ |
Apply text changes, or submit AI prompt |
Enter |
Insert line break (while editing text or AI prompt) |
Escape |
Cancel AI generation → close panel → deselect element → deactivate editor (layered, one press per layer) |
⌘S |
Apply source editor changes |
⌘E |
Open file in Code Editor (from read-only toolbar) |
How edits are saved
All visual editor changes follow the same save pipeline as AI-generated changes:
- VoxelSite uses an element address to find the page or partial source
- It locates the matching content in the PHP source file (page or partial) using a deterministic index-based locator
- If the element is found, the file is updated. If the locator fails, the save falls back to content matching and rejects with a clear error if zero or multiple matches are found
- The change is tracked in the revision system - you can undo it
- Tailwind CSS is recompiled if needed, and the preview refreshes
For source editor changes, the save uses the literal source text as the match needle - so it can match source even when the source contains PHP expressions, multi-line attributes, or whitespace that differs from the browser's rendering. For text edits, the save uses the same index-based locator to precisely replace the element's inner content.
Use the visual editor's operation undo while the editing session remains active. Website revisions and snapshots have separate restore boundaries.
Related
- How Prompting Works - What happens under the hood when AI generates or edits your site
- Chat - The AI conversation panel for describing changes in natural language
- Code Editor - Edit source files directly with syntax highlighting and inline AI
- Undo & snapshots - Restore recorded changes within their saved domains
Found a mistake in these instructions? Open an issue.
Download VoxelSite