Skip to content

WebView

A web view embeds another web page or a piece of raw HTML into your view. The web frontend renders it as an iframe, so the embedded content is isolated from your application. Use it for third-party widgets like videos or maps. It lives in package presentation/ui/webview.

WebView

webview.WebView().
	Title("Embedded page").
	Raw(`<html><body style="font-family: sans-serif; background: #e8f0fe; padding: 16px">
<h3>Embedded HTML</h3>
<p>This content is isolated in an iframe.</p>
</body></html>`).
	Frame(Frame{Width: L400, Height: L200})

Constructors

ConstructorDescription
func WebView() TWebViewCreates an empty web view; set Src or Raw.

Methods

MethodDescription
Allow(allow string) TWebViewSets the permissions policy of the iframe, e.g. autoplay; fullscreen.
Frame(frame ui.Frame) TWebViewSets the layout frame of the web view.
Raw(raw string) TWebViewRaw html code which is passed into the frame.
ReferrerPolicy(referrerpolicy string) TWebViewSets the referrer policy of the iframe, e.g. strict-origin-when-cross-origin.
Src(src core.URI) TWebViewSets the URL of the page to embed.
Title(title string) TWebViewSets the accessible title of the iframe.

Related