Open links in the default browser

    Handle link activation in the host application when a reader should open a document link externally. The editor reports the authored address; your application decides which destinations are allowed.

    Preview and read-only links do not grant unrestricted navigation inside the embedded editing surface.

    Actual Avalonia read-only document preview with the native editor frame.
    Actual Avalonia read-only document preview with the native editor frame.

    Use it in your application

    Validate the address and scheme before launching an external application. The example permits only absolute HTTP and HTTPS addresses.

    Subscribe while the host owns the editor, and detach long-lived handlers when appropriate. A relative address needs an application-owned base before it can be opened externally.

    Keep file and custom-protocol handling as explicit application policy. Do not pass arbitrary authored text directly to a shell.

    editor.LinkClicked += (_, args) =>
    {
        if (Uri.TryCreate(args.Address, UriKind.Absolute, out var uri) &&
            uri.Scheme is "https" or "http")
        {
            Process.Start(new ProcessStartInfo(uri.AbsoluteUri) { UseShellExecute = true });
        }
    };

    Continue with

    Last updated on Oct 18, 2026

    Put this into practice.

    Start with the C# Avalonia sample. Restore this edition's package and install the native browser prerequisites before running it.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.