Skip to content

<inspect-panel>

The <inspect-panel> element renders a fixed-position overlay panel for persistent value inspection during development.

<inspect-panel open position="bottom-right"></inspect-panel>
<script>
const panel = document.querySelector('inspect-panel');
panel.value = {
route: '/dashboard',
user: { name: 'Ada', role: 'admin' },
};
</script>
PropertyTypeDefaultDescription
valueanyundefinedA single value to inspect.
valuesanyundefinedMultiple values to inspect (displayed as a list).
namestring''Label displayed in the panel header.
themestring'inspect'Color theme. One of: inspect, drak, stereo, dark, default-dark, default-light.
searchboolean | stringfalseEnable search. Set to 'filter', 'filter-strict', or 'highlight'.
depthnumberInfinityMax expansion depth.
positionstring'bottom-right'Panel position. One of: bottom-right, bottom-left, top-right, top-left.
openbooleanfalseWhether the panel is expanded.
heightstring'40vh'Panel height when open. Any CSS length value.
widthstring'100%'Panel width. Any CSS length value.
showTypesbooleantrueShow type annotations.
showLengthbooleantrueShow collection lengths.
showPreviewbooleantrueShow inline previews.

The position property controls where the panel anchors:

ValueDescription
bottom-rightFixed to bottom-right corner (default)
bottom-leftFixed to bottom-left corner
top-rightFixed to top-right corner
top-leftFixed to top-left corner
const panel = document.querySelector('inspect-panel');
panel.value = appState;
panel.open = true;
panel.position = 'top-left';
panel.height = '60vh';
panel.width = '400px';
panel.open = true;
panel.value = largeStateTree;
panel.search = 'filter';
panel.open = true;