---
title: DeviceHinge
framework: SwiftUI
role: symbol
role_heading: Structure
platforms: [iOS 27.1+, iPadOS 27.1+]
path: swiftui/devicehinge
---

# DeviceHinge

A type encapsulating the state of a single hinge.

## Declaration

```swift
struct DeviceHinge
```

## Overview

Overview A hinge provides its angle along with a status determined by the system based on the current angle and device orientation. You use this type with the View/onHingeChange(_:) modifier. @State private var hinge: DeviceHinge? = nil

var body: some View {     VStack {         if let hinge {             AngleDisplayView(angle: hinge.angle)             StatusDisplayView(status: hinge.status)         } else {             ContentUnavailableView(                 "Hinge Unavailable",                 systemImage: "rectangle.split.2x1")         }     }     .onHingeChange { _, newContext in         hinge = newContext.hinge     } } In the example above, the current angle and status of the hinge will be displayed in the app as you interact with the hinge.

## Topics

### Getting hinge information

- [angle](swiftui/devicehinge/angle.md)
- [status](swiftui/devicehinge/status-swift.property.md)
- [DeviceHinge.Status](swiftui/devicehinge/status-swift.struct.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Responding to hinge angle changes

- [onHingeChange(isEnabled:_:)](swiftui/view/onhingechange(isenabled:_:).md)
- [DeviceHingeContext](swiftui/devicehingecontext.md)
