---
title: "Custom Preview Item ShareLink | Explore SwiftUI"
description: "Creates an instance, with a custom label, that presents the share interface"
canonical_url: "https://exploreswiftui.com/library/link/custom-preview-item-sharelink"
meta:
  author: "Explore SwiftUI"
  "og:description": "Creates an instance, with a custom label, that presents the share interface"
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Custom%2BPreview%2BItem%2BShareLink%2B%2Cdescription_~Q3JlYXRlcyBhbiBpbnN0YW5jZSwgd2l0aCBhIGN1c3RvbSBsYWJlbCwgdGhhdCBwcmVzZW50cyB0aGUgc2hhcmUgaW50ZXJmYWNl%2Ccategory_Link%2Cimage_~L2FwaS9pbWFnZXMvNzUvdmFyaWFudHMvOTI~dj0xNzkwMDczNDc4ODQyJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L2xpbmsvY3VzdG9tLXByZXZpZXctaXRlbS1zaGFyZWxpbmsi%2Cs_AixgRr6E_uQ7XTCs.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Custom Preview Item ShareLink | Explore SwiftUI"
  "twitter:description": "Creates an instance, with a custom label, that presents the share interface"
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Custom%2BPreview%2BItem%2BShareLink%2B%2Cdescription_~Q3JlYXRlcyBhbiBpbnN0YW5jZSwgd2l0aCBhIGN1c3RvbSBsYWJlbCwgdGhhdCBwcmVzZW50cyB0aGUgc2hhcmUgaW50ZXJmYWNl%2Ccategory_Link%2Cimage_~L2FwaS9pbWFnZXMvNzUvdmFyaWFudHMvOTI~dj0xNzkwMDczNDc4ODQyJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L2xpbmsvY3VzdG9tLXByZXZpZXctaXRlbS1zaGFyZWxpbmsi%2Cs_AixgRr6E_uQ7XTCs.png"
  "twitter:title": "Custom Preview Item ShareLink | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=75)

# **Custom Preview Item ShareLink **

Creates an instance, with a custom label, that presents the share interface

![Custom Preview Item ShareLink  - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/75/variants/92?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 16.0+ iPadOS 16.0+ macOS 13.0+ watchOS 9.0+ visionOS 1.0+

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/sharelink/init(_:item:subject:message:preview:)>)

```
ShareLink(
    "Share Cats",
    item: Image(.cats),
    subject: Text("Cool Photo"),
    message: Text("Check it out!"),
    preview: SharePreview(
        "Derpy Cats",
        image: Image(.cats)
    )
)
```

### **Found an issue or have a suggestion?**

Created: June 5, 2025Updated: December 27, 2025

### **More Link Components **

[**View all **](https://exploreswiftui.com/library/link)

![HelpLink - macOS - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/77/variants/30?v=1790073478842&r=2&w=412&q=75&f=webp)

### **HelpLink**

A button with a standard appearance that opens app-specific help documentation

![TextFieldLink - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/76/variants/192?v=1790073478842&r=2&w=412&q=75&f=webp)

### **TextFieldLink**

A control that requests text input from the user when pressed

![ShareLink - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/74/variants/28?v=1790073478842&r=2&w=412&q=75&f=webp)

### **ShareLink**

A view that controls a sharing presentation

![Link - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/73/variants/207?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Link**

A control for navigating to a URL

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![Labeled Content - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/150/variants/492?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Labeled Content**

Creates a labeled informational view.

![Error Alert - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/196/variants/325?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Error Alert**

Presents an alert when an error is present.

![Page Screen Sheet Size - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/144/variants/478?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Page Screen Sheet Size**

On devices smaller than a page of paper, such as iPhone, Apple Watch, and 8" or 11" iPads, the sheet fills the entire height and, unlike the default sheet on iPad, the full width. On macOS, .page behaves like .fitted.

![Disable Sheet Dismiss Swipe - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/145/variants/486?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Disable Sheet Dismiss Swipe**

Conditionally prevents interactive dismissal of presentations like popovers, sheets, and inspectors. Dragging the sheet is still possible to a limited extent, as shown in the screenshot, but it will never be dismissed.

![CircularProgressViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/80/variants/86?v=1790073478842&r=2&w=412&q=75&f=webp)

### **CircularProgressViewStyle**

The style of a progress view that uses a circular gauge to indicate the partial completion of an activity

![Title Toolbar Item Placement - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/95/variants/279?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Title Toolbar Item Placement**

Places content in the title area

![Custom Labeled Content - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/152/variants/494?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Custom Labeled Content**

Creates a standard labeled element, with a view that conveys the value of the element and a label.

![Color Opacity - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/16/variants/124?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Color Opacity**

The Color opacity modifier

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#webpage","@type":"WebPage","dateModified":"2025-12-27T13:55:41.126Z","datePublished":"2025-06-05T12:22:07.619Z","description":"Creates an instance, with a custom label, that presents the share interface","name":"Custom Preview Item ShareLink","url":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink","breadcrumb":{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#article"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/link/custom-preview-item-sharelink"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#article","citation":"https://developer.apple.com/documentation/swiftui/sharelink/init(_:item:subject:message:preview:)","dateModified":"2025-12-27T13:55:41.126Z","datePublished":"2025-06-05T12:22:07.619Z","description":"Creates an instance, with a custom label, that presents the share interface","headline":"Custom Preview Item ShareLink","inLanguage":"en-US","name":"Custom Preview Item ShareLink","thumbnailUrl":"https://exploreswiftui.com/api/images/75/variants/92?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"hasPart":{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#source-code"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#webpage"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#source-code","@type":"SoftwareSourceCode","codeSampleType":"full example","description":"Creates an instance, with a custom label, that presents the share interface","name":"Custom Preview Item ShareLink  SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"ShareLink(\n    \"Share Cats\",\n    item: Image(.cats),\n    subject: Text(\"Cool Photo\"),\n    message: Text(\"Check it out!\"),\n    preview: SharePreview(\n        \"Derpy Cats\",\n        image: Image(.cats)\n    )\n)","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Link"},{"@type":"Thing","name":"Custom Preview Item ShareLink "}]},{"@id":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"Link","item":"https://exploreswiftui.com/library/link","position":2},{"@type":"ListItem","name":"Custom Preview Item ShareLink ","item":"https://exploreswiftui.com/library/link/custom-preview-item-sharelink","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/75/variants/92?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/75/variants/92?v=1790073478842&r=2"}]}
```