window

package
v0.1.106 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Popup(
	content api.Composable,
	options ...PopupOption,
) api.Composable

Popup shows content overlaid on top of other content. It uses op.Defer to effectively "break out" of the z-order (though it respects parent clipping). The content is laid out with loose constraints (0 to Max).

Types

type PopupAlignment

type PopupAlignment int

PopupAlignment determines how the popup is aligned relative to its anchor point. For now, we assume the anchor point is the top-left of where this Popup is called.

const (
	AlignTopLeft PopupAlignment = iota
)

type PopupOption

type PopupOption func(*PopupOptions)

func WithAlignment

func WithAlignment(alignment PopupAlignment) PopupOption

func WithOffset

func WithOffset(x, y unit.Dp) PopupOption

func WithOnDismissRequest added in v0.1.60

func WithOnDismissRequest(onDismiss func()) PopupOption

type PopupOptions

type PopupOptions struct {
	Alignment        PopupAlignment
	OffsetX          unit.Dp
	OffsetY          unit.Dp
	OnDismissRequest func() // Called when clicking outside the popup content
}

func DefaultPopupOptions

func DefaultPopupOptions() PopupOptions

Jump to

Keyboard shortcuts

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