Link
A control for navigating to a URL
Platform Compatibility
Tags
SwiftUI Code
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?
More Link Components
View allCustom Preview Item ShareLink
Creates an instance, with a custom label, that presents the share interface
Explore Other Components
Browse allPrefer Vertical Toolbar Items
A compression behavior that prioritizes keeping toolbar items visible over other elements, such as tabs. By default, tabs are prioritized.
ContainerRelativeShape
A shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle
UIKit Text Colors
The UIKit text colors that are also used in other components, such as the TextField
List Background Prominence
The prominence of the background underneath views associated with this environment.
Toolbar Title Alignment
Sets the preferred alignment of the navigation bar’s title. The navigation bar resolves the alignment of its title automatically based on context, and toolbar roles. Use this modifier to override that resolution.