modallayer

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModalLayer

ModalLayer is a widget drawn on top of the normal UI that can be populated by other material components modal dialogs. For instance, the App Bar can render its overflow menu within the modal layer, and the modal navigation drawer is entirely within the modal layer.

func NewModal

func NewModal() *ModalLayer

NewModal creates an initializes a modal layer.

func (*ModalLayer) Layout

func (m *ModalLayer) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

Layout renders the modal layer. Unless a modal widget has been triggered, this will do nothing.

type ModalState

type ModalState struct {
	component.ScrimState
	// contains filtered or unexported fields
}

ModalState defines persistent state for a modal.

func (*ModalState) Show

func (m *ModalState) Show(now time.Time, w layout.Widget)

Show widget w in the modal, starting animation at now.

type ModalStyle

type ModalStyle struct {
	*ModalState
	Scrim component.ScrimStyle
}

ModalStyle describes how to layout a modal. Modal content is laid centered atop a clickable scrim.

func Modal(th *material.Theme, modal *ModalState) ModalStyle

Modal lays out a content widget atop a clickable scrim. Clicking the scrim dismisses the modal.

func (ModalStyle) Layout

func (m ModalStyle) Layout(gtx layout.Context) layout.Dimensions

Layout the scrim and content. The content is only laid out once the scrim is fully animated in, and is hidden on the first frame of the scrim's fade-out animation.

Jump to

Keyboard shortcuts

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