Hyperlink
A clickable text element that opens a URL in the user’s default browser.
Basic HyperLink
Section titled “Basic HyperLink”Show Code
package main
import ( "net/url"
"fyne.io/fyne/v2" "fyne.io/fyne/v2/app" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/widget")
func main() { myApp := app.New() myWindow := myApp.NewWindow("Hyperlink")
// Create a URL link, _ := url.Parse("https://fyne.io")
// Create a hyperlink hyperlink := widget.NewHyperlink("Visit Fyne Website", link)
// Set content myWindow.SetContent(container.NewVBox( widget.NewLabel("Click the link below:"), hyperlink, ))
myWindow.Resize(fyne.NewSize(300, 150)) myWindow.ShowAndRun()}