<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Material/materialActiveAppearance(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI8MaterialV24materialActiveAppearanceyAcA0ceF0VF"
  },
  "title" : "materialActiveAppearance(_:)"
}
-->

# materialActiveAppearance(_:)

Sets an explicit active appearance for this material.

```
func materialActiveAppearance(_ appearance: MaterialActiveAppearance) -> Material
```

## Discussion

Materials used as the `window` container background on macOS will
automatically appear inactive when their the window appears inactive, but
can be made to always appear active by setting the active appearance
behavior to be always active:

```
Text("Hello, World!")
    .containerBackground(
        Material.regular.materialActiveAppearance(.active),
        for: .window)
```

---

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)