<!--
{
  "availability" : [
    "iOS: 27.1.0 -",
    "iPadOS: 27.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DeviceHinge",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11DeviceHingeV"
  },
  "title" : "DeviceHinge"
}
-->

# DeviceHinge

A type encapsulating the state of a single hinge.

```
struct DeviceHinge
```

## 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

[`var angle: Angle`](/documentation/SwiftUI/DeviceHinge/angle)

Current angle of the hinge.

[`var status: DeviceHinge.Status`](/documentation/SwiftUI/DeviceHinge/status-swift.property)

Current status of the hinge.

[`struct Status`](/documentation/SwiftUI/DeviceHinge/Status-swift.struct)

The status of an individual hinge.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)