<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ControlWidgetTemplate/disabled(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI21ControlWidgetTemplateP0D3KitE8disabledyQrSbF"
  },
  "title" : "disabled(_:)"
}
-->

# disabled(_:)

Determines whether people can interact with this control.

```
@MainActor @preconcurrency func disabled(_ disabled: Bool) -> some ControlWidgetTemplate
```

## Parameters

`disabled`

A Boolean value that determines whether users can
interact with this control.

## Discussion

Controls also respect the [`disabled(_:)`](/documentation/SwiftUI/View/disabled(_:)) modifier applied to the
control’s label. That modifier only disables the label, however. To
disable the control overall, apply this modifier to the control template:

```
struct GarageDoorOpener: ControlWidget {
    var body: some ControlWidgetConfiguration {
        StaticControlConfiguration(
            kind: "com.myapp.garagedooropener",
            provider: DoorValueProvider()
        ) { door in
            ControlWidgetToggle(...) {
                Label(
                    $0 ? "Open" : "Closed",
                    systemImage: $0 ? "door.open" : "door.closed"
                )
            }
            .disabled(door.isSafetyLockEngaged)
        }
    }
}
```

---

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)