Add a contextual sidebar for document, node, and text editing.
The Inspector is a sidebar that provides a way to inspect and edit the email’s properties. From the Inspector, you can edit document, node, and text properties such as colors, fonts, and padding.View a minimal example of the Inspector at the One Line Editor Inspector demo page.
Add EmailTheming and render
Inspector.Root next to the editor content. The inspector switches
automatically between document, node, and text controls based on the current
selection.
Click the editor background to edit document-level styles. Click a node, such as a button, to edit its properties. Select text to switch to text controls.
Inspector.Root requires the EmailTheming
extension. Without it, the inspector cannot resolve theme defaults or apply
document-level style changes, and it will error.
import { StarterKit } from '@react-email/editor/extensions';import { EmailTheming } from '@react-email/editor/plugins';const extensions = [StarterKit, EmailTheming];
When you render the three default panels without children, the inspector gives
you a ready-made sidebar with sensible controls for common editing tasks using
the standard HTML elements like input and select.
Component
When it appears
Default behavior
Inspector.Document
When the editor is not focused on a specific node or text selection
Controls global theme-backed styles like page background and container settings
Inspector.Node
When a node is focused or selected
Adapts to the current node type and shows sections like attributes, size, typography, padding, border, and background
Inspector.Text
When text is selected
Shows text formatting, alignment, typography, and link color controls
This gives you a complete inspector with no custom UI code required.
The Inspector.Root itself keeps track of what is meant to be inspected. This can either be the document, a node, or a text selection.The <Inspector.Document>, <Inspector.Node>, and <Inspector.Text> components
are convenience components that only render when their respective target is active.
If your custom inspector uses portaled UI like Radix Select, Popover, or
dropdown content, moving focus into that portal can make the editor think it
blurred. That can switch the active inspector target or clear the current text
selection.Wrap the portaled content with EditorFocusScope so focus inside the portal is
still treated as part of the editor UI.
Inspector.Root already includes the required focus-scope provider, so inside
a custom inspector you only need to add EditorFocusScope around the portaled
content. The same pattern works for other portaled Radix components, not just
Select.