Interactive previews iPhone Duo

Hinge State

A type encapsulating the state of a single hinge.

Hinge State - Preview Not Available

Platform Compatibility

iOS 27.1+ iPadOS 27.1+

Tags

SwiftUI Code

Docs
@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

More View Components

View all
Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

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
type

VisionOS background materials

All background materials on visionOS

Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

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
environment

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
modifier

Disabled Toolbar Vertical Behavior

Disables the vertical bar.

Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

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
modifier

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
modifier

Manage Subscriptions Sheet

Opens the manage subscriptions sheet.

Explore Other Components

Browse all
Search Tab Role - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Search Tab Role

On Liquid Glass, this tab is placed in its own group. In left-to-right (LTR) layouts, it will always appear on the right side of the TabView.

Hour Minute Seconds DatePicker - watchOS - Flat Design - Light Mode - Preview
initializer

Hour Minute Seconds DatePicker

A DatePicker for just hour, minute, and second.

Toolbar Item Visibility Priority - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Toolbar Item Visibility Priority

Defines the visibility priority for a toolbar item.

Button - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Button

Three ways to initialize a button

List Row Spacing - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

List Row Spacing

Sets the vertical spacing between two adjacent rows in a List.

Section Index Label and Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Section Index Label and Visibility

Sets the label that is used in a section index to point to this section, typically only a single character long. Changes the visibility of the list section index.

AccessoryCircularGaugeStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

AccessoryCircularGaugeStyle

A gauge style that displays an open ring with a marker that appears at a point along the ring to indicate the gauge’s current value

FieldDatePickerStyle - macOS - Flat Design - Light Mode - Preview
style

FieldDatePickerStyle

A date picker style that displays the components in an editable field