---
title: "init(items:subject:message:preview:label:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/sharelink/init(items:subject:message:preview:label:)"
---

# init(items:subject:message:preview:label:)

Creates an instance that presents the share interface.

## Declaration

```swift
nonisolated init(items: Data, subject: Text? = nil, message: Text? = nil, preview: @escaping (Data.Element) -> SharePreview<PreviewImage, PreviewIcon>, @ContentBuilder label: () -> Label)
```

## Parameters

- `items`: The items to share.
- `subject`: A title for the items to show when sharing to activities that support a subject field.
- `message`: A description of the items to show when sharing to activities that support a message field. Activities may support attributed text or HTML strings.
- `preview`: A closure that returns a representation of each item to render in a preview.
- `label`: A content builder that produces a label that describes the share action.

## See Also

### Sharing items with a preview

- [init(items:subject:message:preview:)](swiftui/sharelink/init(items:subject:message:preview:).md)
- [init(_:items:subject:message:preview:)](swiftui/sharelink/init(_:items:subject:message:preview:).md)
