---
title: "ShareLink | Explore SwiftUI"
description: "A view that controls a sharing presentation. Learn how to use ShareLink in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/link/sharelink"
meta:
  author: "Explore SwiftUI"
  "og:description": "A view that controls a sharing presentation. Learn how to use ShareLink in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_ShareLink%2Cdescription_A%2Bview%2Bthat%2Bcontrols%2Ba%2Bsharing%2Bpresentation%2Ccategory_Link%2Cimage_~L2FwaS9pbWFnZXMvNzQvdmFyaWFudHMvMjg~dj0xNzkwMDczNDc4ODQyJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L2xpbmsvc2hhcmVsaW5rIg%2Cs_cXaFPPd1aOJFXIru.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "ShareLink | Explore SwiftUI"
  "twitter:description": "A view that controls a sharing presentation. Learn how to use ShareLink in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_ShareLink%2Cdescription_A%2Bview%2Bthat%2Bcontrols%2Ba%2Bsharing%2Bpresentation%2Ccategory_Link%2Cimage_~L2FwaS9pbWFnZXMvNzQvdmFyaWFudHMvMjg~dj0xNzkwMDczNDc4ODQyJnI9MiZ3PTEyODAmcT04NSZmPWpwZWc%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L2xpbmsvc2hhcmVsaW5rIg%2Cs_cXaFPPd1aOJFXIru.png"
  "twitter:title": "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=74)

# **ShareLink**

A view that controls a sharing presentation

![ShareLink - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/74/variants/28?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)

```
HStack {
    ShareLink(item: URL(string: "https://exploreswiftui.com")!)
    ShareLink("Explore SwiftUI", item: URL(string: "https://exploreswiftui.com")!)
    .padding(.horizontal)
    ShareLink(item: URL(string: "https://exploreswiftui.com")!) {
        Label("Foo", systemImage: "cube.transparent")
    }
}
```

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

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

![Connect Wizard](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

### **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

![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=412&q=75&f=webp)

### **Custom Preview Item ShareLink **

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

![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/)

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

### **Picker**

Creates a pickers with title, image, systemImage, and custom label.

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

### **List Row Separator Tint**

Sets the tint color associated with a row.

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

### **InlinePickerStyle**

A PickerStyle where each option is displayed inline with other views in the current container.

![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.

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

### **LinearGaugeStyle**

A gauge style that displays a bar with a marker that appears at a point along the bar to indicate the gauge’s current value

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

### **Remove Toolbar Item Margin**

Configures whether the content margins are removed.

![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.

![Role Button With Default Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/134/variants/424?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Role Button With Default Label**

Creates a button that displays a default label.

```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/sharelink#webpage","@type":"WebPage","dateModified":"2025-12-27T13:53:52.597Z","datePublished":"2025-06-05T11:57:06.832Z","description":"A view that controls a sharing presentation. Learn how to use ShareLink in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"ShareLink","url":"https://exploreswiftui.com/library/link/sharelink","breadcrumb":{"@id":"https://exploreswiftui.com/library/link/sharelink#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/link/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/sharelink#article","dateModified":"2025-12-27T13:53:52.597Z","datePublished":"2025-06-05T11:57:06.832Z","description":"A view that controls a sharing presentation. Learn how to use ShareLink in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","headline":"ShareLink","inLanguage":"en-US","name":"ShareLink","thumbnailUrl":"https://exploreswiftui.com/api/images/74/variants/28?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/link/sharelink","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/link/sharelink#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/link/sharelink#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/sharelink","codeSampleType":"full example","description":"A view that controls a sharing presentation. Learn how to use ShareLink in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"ShareLink SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"HStack {\n    ShareLink(item: URL(string: \"https://exploreswiftui.com\")!)\n    ShareLink(\"Explore SwiftUI\", item: URL(string: \"https://exploreswiftui.com\")!)\n    .padding(.horizontal)\n    ShareLink(item: URL(string: \"https://exploreswiftui.com\")!) {\n        Label(\"Foo\", systemImage: \"cube.transparent\")\n    }\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Link"},{"@type":"Thing","name":"ShareLink"}]},{"@id":"https://exploreswiftui.com/library/link/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":"ShareLink","item":"https://exploreswiftui.com/library/link/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/74/variants/28?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/74/variants/28?v=1790073478842&r=2"}]}
```