---
title: "disabled(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/disabled(_:)"
---

# disabled(_:)

Adds a condition that controls whether users can interact with this view.

## Declaration

```swift
nonisolated func disabled(_ disabled: Bool) -> some View

```

## Parameters

- `disabled`: A Boolean value that determines whether users can interact with this view.

## Return Value

Return Value A view that controls whether users can interact with this view.

## Discussion

Discussion The higher views in a view hierarchy can override the value you set on this view. In the following example, the button isn’t interactive because the outer disabled(_:) modifier overrides the inner one: HStack {     Button(Text("Press")) {}     .disabled(false) } .disabled(true)

## See Also

### Managing view interaction

- [isEnabled](swiftui/environmentvalues/isenabled.md)
- [interactionActivityTrackingTag(_:)](swiftui/view/interactionactivitytrackingtag(_:).md)
- [invalidatableContent(_:)](swiftui/view/invalidatablecontent(_:).md)
