<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/labelsHidden()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE12labelsHiddenQryF"
  },
  "title" : "labelsHidden()"
}
-->

# labelsHidden()

Hides the labels of any controls contained within this view.

```
nonisolated func labelsHidden() -> some View
```

## Discussion

Use this modifier when you want to omit a label from one or more
controls in your user interface. For example, the first [`Toggle`](/documentation/SwiftUI/Toggle) in
the following example hides its label:

```
VStack {
    Toggle(isOn: $toggle1) {
        Text("Toggle 1")
    }
    .labelsHidden()

    Toggle(isOn: $toggle2) {
        Text("Toggle 2")
    }
}
```

The [`VStack`](/documentation/SwiftUI/VStack) in the example above centers the first toggle’s control
element in the available space, while it centers the second toggle’s
combined label and control element:

![A screenshot showing a view with two toggle controls where one label](images/com.apple.SwiftUI/View-labelsHidden-1@2x.png)

Always provide a label for controls, even when you hide the label,
because SwiftUI uses labels for other purposes, including accessibility.

> Note: This modifier doesn’t work for all labels. It applies to
> labels that are separate from the rest of the control’s interface,
> like they are for ``doc://com.apple.SwiftUI/documentation/SwiftUI/Toggle``, but not to controls like a bordered
> button where the label is inside the button’s border.

---

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)