---
title: "Inspector | Explore SwiftUI"
description: "Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class"
canonical_url: "https://exploreswiftui.com/library/view/inspector"
meta:
  author: "Explore SwiftUI"
  "og:description": "Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class"
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Inspector%2Cdescription_Adds%2Ban%2Binspector%2Bto%2Ba%2Bview.%2BIt%2Bcan%2Bappear%2Bas%2Ba%2Btrailing%2Bcolumn%2Bin%2Ba%2Bregular%2Bhorizontal%2Bsize%2Bclass%2Bor%2Bas%2Ba%2Bsheet%2Bin%2Ba%2Bcompact%2Bhorizontal%2Bsize%2Bclass.%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjgxL3ZhcmlhbnRzLzM0NDE~dj0xNzk2NTcwODQ3MjcwJnI9MiZ3PTY0MCZoPTQ4MCZmPXBuZw%2CimageMode_fit%2CimagePosition_center%2CimageFrame_~Ym9yZGVyLXJhZGl1czogMTJweCAwcHggMHB4IDEycHg7IGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci1yaWdodDogMDsgYm94LXNoYWRvdzogMCAtMTBweCA1MHB4IHJnYmEoMzcsOTksMjM1LDAuMTgpOw%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiXX0%2Cp_Ii9saWJyYXJ5L3ZpZXcvaW5zcGVjdG9yIg%2Cs__uoRlAsh-gBphhvK.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Inspector | Explore SwiftUI"
  "twitter:description": "Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class"
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Inspector%2Cdescription_Adds%2Ban%2Binspector%2Bto%2Ba%2Bview.%2BIt%2Bcan%2Bappear%2Bas%2Ba%2Btrailing%2Bcolumn%2Bin%2Ba%2Bregular%2Bhorizontal%2Bsize%2Bclass%2Bor%2Bas%2Ba%2Bsheet%2Bin%2Ba%2Bcompact%2Bhorizontal%2Bsize%2Bclass.%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjgxL3ZhcmlhbnRzLzM0NDE~dj0xNzk2NTcwODQ3MjcwJnI9MiZ3PTY0MCZoPTQ4MCZmPXBuZw%2CimageMode_fit%2CimagePosition_center%2CimageFrame_~Ym9yZGVyLXJhZGl1czogMTJweCAwcHggMHB4IDEycHg7IGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci1yaWdodDogMDsgYm94LXNoYWRvdzogMCAtMTBweCA1MHB4IHJnYmEoMzcsOTksMjM1LDAuMTgpOw%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiXX0%2Cp_Ii9saWJyYXJ5L3ZpZXcvaW5zcGVjdG9yIg%2Cs__uoRlAsh-gBphhvK.png"
  "twitter:title": "Inspector | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[iPhone Duo](https://exploreswiftui.com/duo?element=281) [iPhone](https://exploreswiftui.com/iphone?element=281) [iPad](https://exploreswiftui.com/ipad?element=281)

# **Inspector**

Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class.

![Inspector - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/281/variants/3441?v=1796570847270&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 17.0+ iPadOS 17.0+ macOS 14.0+

### **Tags**

[**modifier**](https://exploreswiftui.com/?search=modifier "Search for modifier (opens in a new tab)")

### **SwiftUI Code**

[Docs](<https://developer.apple.com/documentation/swiftui/view/inspector(ispresented:content:)>)

```
@State private var showInspector = true

var body: some View {
    Text("Foo")
        .inspector(isPresented: $showInspector) {
            Text("Bar")
        }
}
```

### **Found an issue or have a suggestion?**

Created: December 6, 2026Updated: December 6, 2026

### **More View Components **

[**View all **](https://exploreswiftui.com/library/view)

![Dialog Icon - macOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/279/variants/3342?v=1796370119604&r=2&w=412&q=75&f=webp)

### **Dialog Icon**

Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms.

![Text Tightening - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/275/variants/3308?v=1796318332299&r=2&w=412&q=75&f=webp)

### **Text Tightening**

Sets whether text in this view can compress the space between characters when necessary to fit text in a line.

![Symbol Rendering Mode - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/277/variants/3314?v=1796314720618&r=2&w=412&q=75&f=webp)

### **Symbol Rendering Mode**

Sets the rendering mode for symbol images within this view.

![Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/262/variants/2227?v=1794899667529&r=2&w=412&q=75&f=webp)

### **Scroll Gesture Axis Lock**

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

![VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/260/variants/2143?v=1793707679045&r=2&w=412&q=75&f=webp)

### **VisionOS background materials**

All background materials on visionOS

![Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/257/variants/1987?v=1792070676534&r=2&w=412&q=75&f=webp)

### **Container Content Margins**

Adds the margins of the container the view is in.

![Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/254/variants/1863?v=1790589836833&r=2&w=412&q=75&f=webp)

### **Toolbar Vertical Edge**

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

![Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2&w=412&q=75&f=webp)

### **Hinge State**

A type encapsulating the state of a single hinge.

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![Sheet Drag Indicator Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/138/variants/428?v=1794864619111&r=2&w=412&q=75&f=webp)

### **Sheet Drag Indicator Visibility**

Sets the visibility of the drag indicator on top of a sheet.

![Link - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/73/variants/207?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Link**

A control for navigating to a URL

![Tab View Customization Behavior - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/166/variants/669?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Tab View Customization Behavior**

Configures the customization behavior of customizable tab view content.

![Toolbar Title Alignment - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/258/variants/2111?v=1793542963212&r=2&w=412&q=75&f=webp)

### **Toolbar Title Alignment**

Sets the preferred alignment of the navigation bar’s title. The navigation bar resolves the alignment of its title automatically based on context, and toolbar roles. Use this modifier to override that resolution.

![Value Tab View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/165/variants/616?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Value Tab View**

Creates a tab view that uses a builder to create and specify selection values for its tabs.

![Semantic Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/8/variants/51?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Semantic Colors**

![UIKit Fill Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/11/variants/43?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Fill Colors**

![Color Opacity - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/16/variants/124?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Color Opacity**

The Color opacity modifier

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/inspector#webpage","@type":"WebPage","dateModified":"2026-12-06T15:27:27.270Z","datePublished":"2026-12-06T15:21:00.000Z","description":"Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class","name":"Inspector","url":"https://exploreswiftui.com/library/view/inspector","breadcrumb":{"@id":"https://exploreswiftui.com/library/view/inspector#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/view/inspector#article"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/view/inspector"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/view/inspector#article","citation":"https://developer.apple.com/documentation/swiftui/view/inspector(ispresented:content:)","dateModified":"2026-12-06T15:27:27.270Z","datePublished":"2026-12-06T15:21:00.000Z","description":"Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class","headline":"Inspector","inLanguage":"en-US","name":"Inspector","thumbnailUrl":"https://exploreswiftui.com/api/images/281/variants/3441?v=1796570847270&r=2","url":"https://exploreswiftui.com/library/view/inspector","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"hasPart":{"@id":"https://exploreswiftui.com/library/view/inspector#source-code"},"image":{"@id":"https://exploreswiftui.com/library/view/inspector#/schema/image/1"},"isPartOf":{"@id":"https://exploreswiftui.com/library/view/inspector#webpage"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/view/inspector#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/inspector#source-code","@type":"SoftwareSourceCode","codeSampleType":"full example","description":"Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class","name":"Inspector SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"@State private var showInspector = true\n\nvar body: some View {\n    Text(\"Foo\")\n        .inspector(isPresented: $showInspector) {\n            Text(\"Bar\")\n        }\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"View"},{"@type":"Thing","name":"Inspector"}]},{"@id":"https://exploreswiftui.com/library/view/inspector#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"View","item":"https://exploreswiftui.com/library/view","position":2},{"@type":"ListItem","name":"Inspector","item":"https://exploreswiftui.com/library/view/inspector","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/library/view/inspector#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/281/variants/3441?v=1796570847270&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/281/variants/3441?v=1796570847270&r=2"}]}
```