Components
Inspector
Inspector presents supplemental controls or contextual details beside primary content.
Inspector presents supplemental controls or contextual details beside primary content.
Examples
Basic Usage
Preview unavailable for this example in the static docs build.
Show code
function Demo(props: Partial<IInspectorProps>) {
const [isPresented, setIsPresented] = useState(true)
return (
<VStack spacing={12}>
<Button onClick={() => setIsPresented((value) => !value)}>
{isPresented ? 'Hide inspector' : 'Show inspector'}
</Button>
<Inspector
content={
<VStack spacing={8}>
<Text>Selection details</Text>
<Text>Properties</Text>
<Text>Actions</Text>
</VStack>
}
isPresented={isPresented}
onOpenChange={setIsPresented}
style={{ minHeight: '280px' }}
title="Inspector"
{...props}
>
<VStack spacing={8}>
<Text>Main document content</Text>
<Text>Inspector is useful for secondary controls and metadata.</Text>
</VStack>
</Inspector>
</VStack>
)
}Leading Placement
Preview unavailable for this example in the static docs build.
Show code
<Demo placement="leading" />API
| Prop | Type | Required | Description |
|---|---|---|---|
isPresented | boolean | Yes | Whether the inspector is visible. |
onOpenChange | (isPresented: boolean) => void | No | Called when the visibility should change. |
content | ReactNode | Yes | Inspector content rendered in the side panel. |
placement | 'leading' | 'trailing' | No | Placement of the inspector relative to the main content. Default: 'trailing' |
width | number | string | No | Panel width. Default: 320 |
title | string | No | Accessible title for the inspector region. |
dismissLabel | string | No | Dismiss button label. Default: 'Hide inspector' |
Inherits additional props from IBaseComponent.
Overview
Inspector presents supplemental controls or contextual details beside primary content.
SwiftUI Correspondence: Adapts SwiftUI's inspector(isPresented:content:) to a React container component.
Notes
- Use
isPresentedandonOpenChangeto control visibility from React state - Use
contentfor the secondary inspection panel - Use
placement="leading"when the inspector should appear before primary content