<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/EnvironmentValues/documentConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17EnvironmentValuesVAAE21documentConfigurationAA08DocumentF0VSgvp"
  },
  "title" : "documentConfiguration"
}
-->

# documentConfiguration

The configuration of a document in a [`DocumentGroup`](/documentation/SwiftUI/DocumentGroup).

```
var documentConfiguration: DocumentConfiguration? { get }
```

## Discussion

The value is `nil` for views that are not enclosed in a [`DocumentGroup`](/documentation/SwiftUI/DocumentGroup).

For example, if the app shows the document path in the footer
of each document, it can get the URL from the environment:

```
struct ContentView: View {
    @Binding var document: TextDocument
    @Environment(\.documentConfiguration) private var configuration: DocumentConfiguration?

    var body: some View {
        …
        Label(
            configuration?.fileURL?.path ??
                "", systemImage: "folder.circle"
        )
    }
}
```

---

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)