web

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for js/wasm

Overview

Package web is NSGo's browser backend: Go compiled to WebAssembly, one absolutely positioned element per view. Text is measured with the browser's own layout in a hidden element styled as the one that draws it, so measuring and drawing agree. The browser loads and draws images from their URIs, and alerts are dialogs drawn over the page.

In WebAssembly the engine goroutine shares the page's only thread, so text is measured and batches are applied right where the engine asks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(app engine.App, opts Options)

Run fills the page with app. Call it from main; it does not return.

Types

type Options

type Options struct {
	// Mount is the CSS selector of the element the app fills; the body
	// when empty.
	Mount string
	// ID names the app's entries in localStorage.
	ID string
	// Components are the native components Native elements name.
	Components driver.NativeComponents
	// Fonts are font files under the app's resources, registered before
	// the first view.
	Fonts []string
	// Appearance is the appearance the app starts in.
	Appearance driver.Appearance
	// Host names the global the loader keeps the page's host bridge in
	// (host.go); without one the app has no host.
	Host string
}

Options configure the page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL