---
title: "Hinge State | Explore SwiftUI"
description: "A type encapsulating the state of a single hinge. Learn how to use Hinge State in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/view/hinge-state"
meta:
  author: "Explore SwiftUI"
  "og:description": "A type encapsulating the state of a single hinge. Learn how to use Hinge State in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Hinge%2BState%2Cdescription_A%2Btype%2Bencapsulating%2Bthe%2Bstate%2Bof%2Ba%2Bsingle%2Bhinge.%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjQ5L3ZhcmlhbnRzLzE3NjU~dj0xNzkzMDk5NTc1NjI3JnI9MiZ3PTY0MCZoPTQ4MCZmPXBuZw%2CimageMode_fit%2CimagePosition_center%2CimageFrame_~Ym9yZGVyLXJhZGl1czogMzNweCAwcHggMHB4IDMzcHg7IGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci1yaWdodDogMDsgYm94LXNoYWRvdzogMCAtMTBweCA1MHB4IHJnYmEoMzcsOTksMjM1LDAuMTgpOw%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIl19%2Cp_Ii9saWJyYXJ5L3ZpZXcvaGluZ2Utc3RhdGUi%2Cs_FQUXiR9hAZpdb3aN.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Hinge State | Explore SwiftUI"
  "twitter:description": "A type encapsulating the state of a single hinge. Learn how to use Hinge State in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Hinge%2BState%2Cdescription_A%2Btype%2Bencapsulating%2Bthe%2Bstate%2Bof%2Ba%2Bsingle%2Bhinge.%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjQ5L3ZhcmlhbnRzLzE3NjU~dj0xNzkzMDk5NTc1NjI3JnI9MiZ3PTY0MCZoPTQ4MCZmPXBuZw%2CimageMode_fit%2CimagePosition_center%2CimageFrame_~Ym9yZGVyLXJhZGl1czogMzNweCAwcHggMHB4IDMzcHg7IGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci1yaWdodDogMDsgYm94LXNoYWRvdzogMCAtMTBweCA1MHB4IHJnYmEoMzcsOTksMjM1LDAuMTgpOw%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIl19%2Cp_Ii9saWJyYXJ5L3ZpZXcvaGluZ2Utc3RhdGUi%2Cs_FQUXiR9hAZpdb3aN.png"
  "twitter:title": "Hinge State | 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=249)

# **Hinge State**

A type encapsulating the state of a single hinge.

![Hinge State - Preview Not Available](https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 27.1+ iPadOS 27.1+

### **Tags**

### **SwiftUI Code**

[ Docs](https://developer.apple.com/documentation/swiftui/devicehinge?changes=_3_14)

```
@State private var hinge: DeviceHinge? = nil

var body: some View {
    VStack {
        if let hinge {
            Text("Status \(hinge.status)")
            Text("Angle \(hinge.angle.degrees, specifier: "%.0f")°")
        } else {
            ContentUnavailableView(
                "Hinge Unavailable",
                systemImage: "rectangle.split.2x1"
            )
        }
    }
    .onHingeChange { _, newContext in
        hinge = newContext.hinge
    }
}
```

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

Created: September 26, 2026Updated: October 27, 2026

![Connect Wizard](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

### **More View Components **

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

![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.

![Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/246/variants/1636?v=1790277107518&r=2&w=412&q=75&f=webp)

### **Disabled Toolbar Vertical Behavior**

Disables the vertical bar.

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

### **Music Picker**

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

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

### **App Store Overlay**

Presents a StoreKit overlay when a given condition is true.

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

### **Manage Subscriptions Sheet**

Opens the manage subscriptions sheet.

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

### **Swipe Container**

Only allows a single active swipe within a container.

### **Explore Other Components **

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

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

### **Glass Effect Container**

A view that combines multiple Liquid Glass shapes into a single shape that can morph individual shapes into one another

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

### **Materials**

All materials

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

### **Tab View Side Bar Footer**

Adds a custom footer to the sidebar of a tab view.

![EllipticalListStyle - watchOS - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/103/variants/327?v=1790073478842&r=2&w=412&q=75&f=webp)

### **EllipticalListStyle**

The list style that describes the behavior and appearance of an elliptical list.

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

### **MenuControlGroupStyle**

A control group style that presents its content as a menu when the user presses the control, or as a submenu when nested within a larger menu

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

### **UIKit Label Colors**

![GroupedTabViewStyle - macOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/160/variants/514?v=1790073478842&r=2&w=412&q=75&f=webp)

### **GroupedTabViewStyle**

A tab view style that displays a tab bar that groups its tabs together.

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

### **Bottom Accessory**

A modifier to place content above the tabs

```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/hinge-state#webpage","@type":"WebPage","dateModified":"2026-10-27T11:12:55.686Z","datePublished":"2026-09-26T10:59:55.310Z","description":"A type encapsulating the state of a single hinge. Learn how to use Hinge State in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Hinge State","url":"https://exploreswiftui.com/library/view/hinge-state","breadcrumb":{"@id":"https://exploreswiftui.com/library/view/hinge-state#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/view/hinge-state"]}],"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/hinge-state#article","dateModified":"2026-10-27T11:12:55.686Z","datePublished":"2026-09-26T10:59:55.310Z","description":"A type encapsulating the state of a single hinge. Learn how to use Hinge State in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","headline":"Hinge State","inLanguage":"en-US","name":"Hinge State","thumbnailUrl":"https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2","url":"https://exploreswiftui.com/library/view/hinge-state","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/view/hinge-state#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/hinge-state#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/devicehinge?changes=_3_14","codeSampleType":"full example","description":"A type encapsulating the state of a single hinge. Learn how to use Hinge State in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Hinge State SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"@State private var hinge: DeviceHinge? = nil\n\nvar body: some View {\n    VStack {\n        if let hinge {\n            Text(\"Status \\(hinge.status)\")\n            Text(\"Angle \\(hinge.angle.degrees, specifier: \"%.0f\")°\")\n        } else {\n            ContentUnavailableView(\n                \"Hinge Unavailable\",\n                systemImage: \"rectangle.split.2x1\"\n            )\n        }\n    }\n    .onHingeChange { _, newContext in\n        hinge = newContext.hinge\n    }\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"View"},{"@type":"Thing","name":"Hinge State"}]},{"@id":"https://exploreswiftui.com/library/view/hinge-state#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":"Hinge State","item":"https://exploreswiftui.com/library/view/hinge-state","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/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2"}]}
```