Skip to main content

OpenUrl

Opens a URL when the control is activated.

Equivalent to UrlLauncher.launch_url, but performed by the client inside the user's gesture, so that opening a new tab is not blocked as an unsolicited popup.

Example
ft.Button(
"Open flet.dev",
action=ft.OpenUrl("https://flet.dev", target=ft.UrlTarget.BLANK),
)

Inherits: ClientAction

Properties

Properties

targetclass-attributeinstance-attribute

target: UrlTarget | str | None = action_field(None)

Where to open the URL, for example UrlTarget.BLANK for a new tab.

Web-only; ignored on other platforms.

urlclass-attributeinstance-attribute

url: str = action_field()

The URL to open.