Quick start
Add EmailTheming and renderInspector.Root next to the editor content. The inspector switches
automatically between document, node, and text controls based on the current
selection.
Required extension
Inspector.Root requires the EmailTheming
extension. Without it, the inspector cannot resolve theme defaults or apply
document-level style changes, and it will error.
Zero-config defaults
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 |
Breadcrumb navigation
UseInspector.Breadcrumb to show the current path from the document root down
to the focused node, and let users jump back up the hierarchy.
Customizing the Inspector
The Inspector.Root itself keeps track of what is supposed to be inspected, which is either 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.
Inspector.Document
Looks up the current value for a document-level style property.
Updates an existing style entry or adds a new one.
Applies multiple document-level style updates in one call.
Inspector.Node
The currently focused node type, such as
image, button, or section.Reads a resolved style value from the active node.
Updates a single inline style on the active node.
Applies multiple style updates in one call.
Reads a node attribute such as
alt, href, or width.Updates a node attribute.
The resolved theme defaults for the current node before inline overrides.
Colors collected from the current document that can be reused in custom controls.
The ProseMirror position metadata for the focused node.
Inspector.Text
A map of active text marks like
bold, italic, underline, strike, and code.Toggles a text mark on the current selection.
The current alignment of the parent text block.
Updates the alignment of the parent text block.
The current link URL when the selection is inside a link.
The resolved color for the active link.
Updates the color of the active link.
Whether the current text selection is inside a link.
Reads a resolved style value from the parent text block.
Updates a style on the parent text block.
Colors collected from the current document that can be reused in custom controls.
Using portals without losing inspector focus
If your custom inspector uses portaled UI like RadixSelect, 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.
Reusing built-in sections
You can also mix custom layouts with the built-in section components.| Component | Description |
|---|---|
Inspector.Attributes | Editable node attributes using field types inferred from the attribute schema |
Inspector.Background | Background color control for nodes |
Inspector.Border | Border width, style, color, and radius controls |
Inspector.Link | Link URL and link color controls for active text links |
Inspector.Padding | Four-sided padding editor |
Inspector.Size | Width and height controls |
Inspector.Typography | Color, size, line height, marks, and alignment controls |
Examples
See the inspector in action with runnable examples:Inspector — Defaults
Zero-config document, node, and text inspectors.
Inspector — Composed
Showing how to use default sections and add a custom one.
Inspector — Fully Custom
Fully custom inspector UI built from render props.