---
title: "init(_:contentType:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/newdocumentbutton/init(_:contenttype:)"
---

# init(_:contentType:)

Creates and opens new documents.

## Declaration

```swift
nonisolated init(_ label: Text? = nil, contentType: UTType? = nil)
```

## Parameters

- `label`: A label to use for the button.
- `contentType`: An optional content type of the document to create.
