Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
View

Link

A control that opens a URL.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
fun Link(title: String, destination: String, modifier: Modifier = Modifier)

Overview

Link("Terms of service", destination = "https://example.com/terms")

This is the Kotlin form of SwiftUI Link.init(_:destination:): SwiftUI documentation. In Swift it reads:

nonisolated init<S>(_ title: S, destination: URL) where S : StringProtocol

Topics

Creating a Link

fun Link(destination: String, modifier: Modifier = Modifier, content: @Composable () -> Unit)
SwiftUI Link.init(destination:label:)
fun Link(title: String, destination: String, modifier: Modifier = Modifier)
SwiftUI Link.init(_:destination:)
fun Link(titleResource: LocalizedKey, destination: String, modifier: Modifier = Modifier)
SwiftUI Link.init(_:destination:)
fun Link(titleKey: LocalizedKey? = null, destination: String? = null, modifier: Modifier = Modifier)
SwiftUI Link · (e.g. Image(systemName = SFSymbol.star)).

Methods

fun LinkDestination(titleKey: LocalizedKey, destination: String, modifier: Modifier = Modifier)
SwiftUI Link.init(_:destination:)