Using the hierarchy
The Elements tab is the inspector's live DOM and style editor. It shows the same reconciled tree the renderer is drawing, including component and text nodes.
Open the inspector
Devtools are enabled by default for desktop. Set
EnableDevTools = true on [AppRoot] (or in
WindowSettings) when configuring a custom host.
[AppRoot(
Width = 1180,
Height = 760,
Title = "My app",
EnableDevTools = true)]
public sealed class App : Component
{
public override Node Render() => H("main");
}
Toggle the panel with:
- F12
- Ctrl + Shift + I
The toolbar also has a dock button for the bottom edge, a dock button for the right edge, a window mode and a close button. Docked panels shrink the app viewport instead of covering it. Drag the splitter to resize.
The Elements layout
The tab is split into two panes. The left pane is the hierarchy; the right pane is the style editor for the selected node.
┌─────────────────────────────────────────────────────────────┐
│ Elements Performance Animations Deploy ⌖ ▤ ▥ × │
├──────────────────────────────┬──────────────────────────────┤
│ DOM tree │ styles │
│ ▾ main.app │ element.style │
│ ▾ section.card │ .card { ... } │
│ ▸ h2.card-title │ .card-action:hover { ... } │
│ ▸ p.card-copy │ │
└──────────────────────────────┴──────────────────────────────┘
Walking the hierarchy
- Click a row to select it. The style pane updates immediately.
- Use the caret to expand or collapse a node with children.
- Hover a row to highlight the corresponding element in the app.
- Component rows show the component type and can expand into their rendered output.
- Text nodes appear as quoted, non-expandable rows.
- Fragments and providers are transparent and expand in place.
The inspect button (the crosshair in the toolbar) lets you pick an element directly from the app. Click the picker, then click any app element. The inspector selects it and expands its path. Inspect mode is cleared after a pick.
Editing styles
The right pane shows an element.style group first for the
selected element, followed by matched rules. Each group lists its
declarations; the inspector groups rules by selector and keeps the live
stylesheet order.
- Click a declaration value to edit it.
- Use the colour swatch or picker for colour values.
- Open + Add property to add a declaration to a rule or to the element style.
- Edits are queued and applied on the frame thread, so the UI stays responsive.
- Element-style edits affect only the selected element; rule edits update the stylesheet.
element.style first. Once a value is
right, move it into the component's CSS rule so it survives a remount.
Selection and refreshes
The inspector is a normal UILab tree, separate from the app tree. It refreshes when the app tree changes and prunes selections or expansion entries whose nodes have left the tree. If an element is removed, its selection is cleared safely rather than pointing at a dead node.
Keyboard and APIs
| Action | How |
|---|---|
| Toggle inspector | F12 or Ctrl+Shift+I |
| Show / hide / toggle from code | ShowDevTools(), HideDevTools(), ToggleDevTools() |
| Dock | Toolbar buttons, or DevTools.Dock |
| Resize | Drag the splitter |