---
title: "Link | Explore SwiftUI"
description: "A control for navigating to a URL. Learn how to use Link in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
canonical_url: "https://exploreswiftui.com/library/link/link"
meta:
  author: "Explore SwiftUI"
  "og:description": "A control for navigating to a URL. Learn how to use Link in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Link%2Cdescription_A%2Bcontrol%2Bfor%2Bnavigating%2Bto%2Ba%2BURL%2Ccategory_Link%2Cimage_~L2FwaS9pbWFnZXMvNzMvdmFyaWFudHMvMjA3P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L2xpbmsvbGluayI%2Cs_R0EhJl0ISR9plb1N.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Link | Explore SwiftUI"
  "twitter:description": "A control for navigating to a URL. Learn how to use Link in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Link%2Cdescription_A%2Bcontrol%2Bfor%2Bnavigating%2Bto%2Ba%2BURL%2Ccategory_Link%2Cimage_~L2FwaS9pbWFnZXMvNzMvdmFyaWFudHMvMjA3P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidHZPUyIsInZpc2lvbk9TIl19%2Cp_Ii9saWJyYXJ5L2xpbmsvbGluayI%2Cs_R0EhJl0ISR9plb1N.png"
  "twitter:title": "Link | Explore SwiftUI"
---

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

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

# **Link**

A control for navigating to a URL

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

### **Platform Compatibility**

iOS 14.0+ iPadOS 14.0+ macOS 11.0+ watchOS 7.0+ tvOS 14.0+ visionOS 1.0+

### **Tags**

### **SwiftUI Code**

[ Docs](https://developer.apple.com/documentation/swiftui/link)

```
Link("Explore SwiftUI", destination: URL(string: "https://exploreswiftui.com")!)
    .environment(\.openURL, OpenURLAction { url in
        print("Open \(url)")
        return .handled
    })
```

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

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

### **Explore Other Components **

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

![Hide Sidebar Toggle - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/255/variants/1925?v=1791377398818&r=2&w=412&q=75&f=webp)

### **Hide Sidebar Toggle**

Removes the sidebar toggle toolbar item a NavigationSplitView adds by default.

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

### **LinearProgressViewStyle**

A progress view that visually indicates its progress using a horizontal bar

![Background Extension Effect - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/91/variants/422?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Background Extension Effect**

Adds the background extension effect to the view. The view will be duplicated into mirrored copies which will be placed around the view on any edge with available safe area. Additionally, a blur effect will be applied on top to blur out the copies

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

### **Product View**

Creates a view to load and merchandise an individual product from the App Store.

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

### **Uniform Concentric Rectangle**

Create a rectangle with the same corner style set on four corners.

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

### **Multiple Sources Picker**

Creates a picker that updates the selected property for all sources.

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

### **DatePicker Colors**

Customizing the colors of the date picker

![Capsule Text Field - macOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/240/variants/186?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Capsule Text Field**

Gives your text field a capsule shape. This only has a visible effect on macOS, where the capsule shape is not the default.

```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/link#webpage","@type":"WebPage","dateModified":"2025-12-27T19:27:24.980Z","datePublished":"2025-06-05T11:49:18.884Z","description":"A control for navigating to a URL. Learn how to use Link in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Link","url":"https://exploreswiftui.com/library/link/link","breadcrumb":{"@id":"https://exploreswiftui.com/library/link/link#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/link/link"]}],"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/link#article","dateModified":"2025-12-27T19:27:24.980Z","datePublished":"2025-06-05T11:49:18.884Z","description":"A control for navigating to a URL. Learn how to use Link in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","headline":"Link","inLanguage":"en-US","name":"Link","thumbnailUrl":"https://exploreswiftui.com/api/images/73/variants/207?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/link/link","@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/link#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/link/link#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/link","codeSampleType":"full example","description":"A control for navigating to a URL. Learn how to use Link in SwiftUI with visual code examples for iOS, macOS, watchOS, tvOS, and visionOS.","name":"Link SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"Link(\"Explore SwiftUI\", destination: URL(string: \"https://exploreswiftui.com\")!)\n    .environment(\\.openURL, OpenURLAction { url in\n        print(\"Open \\(url)\")\n        return .handled\n    })","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Link"},{"@type":"Thing","name":"Link"}]},{"@id":"https://exploreswiftui.com/library/link/link#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":"Link","item":"https://exploreswiftui.com/library/link/link","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/73/variants/207?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/73/variants/207?v=1790073478842&r=2"}]}
```