portals

command
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 6 Imported by: 0

README

20 Portals

This example demonstrates the public ui.Portal(...) API.

Current Status

This is the focused integrated portal example in the numbered examples set.

Use it when you want to inspect how modal, tooltip, and popover surfaces can render into a dedicated DOM host outside #app while the logical controls remain in the normal component tree.

Serve examples from the repo root with:

go run ./tools/gwc examples

Then open:

/examples/public/portals/portals.html

It renders:

  • a modal dialog
  • a tooltip surface
  • a popover card

All three overlays mount into #portal-root instead of the logical #app tree.

What It Shows

  • selector-targeted portal mounting through ui.PortalProps{Target: ui.PortalTarget{Selector: "#portal-root"}}
  • overlay cleanup when the modal, tooltip, or popover closes
  • separation between logical component ownership and physical DOM placement

Documentation

Rendered for js/wasm
The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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