跳到正文

Toast

显示定时堆叠通知,支持操作、关闭和滑动手势。

正在加载交互演示…

#导入

从 github.com/egoist/quickgui/go/ui 导入 ui。

import (
	"github.com/egoist/quickgui/go/ui"
)

#用法

func ToastExample() *ui.Element {
	toast := ui.NewToast(ui.ToastProviderProps{Timeout: 5000, Limit: 3})
	return toast.Provider().Child(func() *native.Node {
		manager := ui.UseToastManager()
		save := ui.Button().Child("Save").OnClick(func() {
			manager.Add(ui.ToastRequest{Title: "Saved", Type: "success"})
		})
		viewport := toast.Viewport().Child(
			ui.For(manager.Toasts, func(item ui.ToastDeclaration, _ func() int) *ui.Element {
				return toast.Root(ui.ToastPartProps{ToastID: item.ID}).Children(
					toast.Title(ui.ToastPartProps{ToastID: item.ID}).Child(item.Title),
					toast.Close(ui.ToastPartProps{ToastID: item.ID}).Child("Dismiss"),
				)
			}, func(item ui.ToastDeclaration) any {
				return item.ID
			}, nil),
		)
		return ui.Fragment(save, viewport)
	})
}

#结构

  • toast.Provider
  • toast.Portal
  • toast.Viewport
  • toast.Positioner
  • toast.Root
  • toast.Content
  • toast.Title
  • toast.Description
  • toast.Action
  • toast.Close

#API 参考

展开条目查看说明和完整签名。短横线表示声明中未记录默认值。

NewToast

查看源码
ui.NewToast(props ...ToastProviderProps) *ToastComponent

NewToast declares a Toast instance. Optional props provide initial settings.

ChildrenComponent—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

Component
查看源码
Timeoutany—

Inherited auto-dismiss duration or warm-provider timeout.

any
查看源码
Limitany—

Maximum number of notifications visible at once.

any
查看源码
Expanded*bool—

Controlled expanded tree node identifiers.

*bool
查看源码
SwipeDirectionToastSwipeDirection—

Edge toward which a swipe dismisses or moves the surface.

ToastSwipeDirection
查看源码
Pitchany—

Logical pixels of scrub motion required for one step.

any
查看源码

Toast.Timeout

查看源码
toast.Timeout(value any) *ToastComponent

Inherited auto-dismiss duration or warm-provider timeout.

Toast.Limit

查看源码
toast.Limit(value any) *ToastComponent

Maximum number of notifications visible at once.

Toast.Expanded

查看源码
toast.Expanded(value bool) *ToastComponent

Controlled expanded tree node identifiers.

Toast.SwipeDirection

查看源码
toast.SwipeDirection(value ToastSwipeDirection) *ToastComponent

Edge toward which a swipe dismisses or moves the surface.

Toast.Pitch

查看源码
toast.Pitch(value any) *ToastComponent

Logical pixels of scrub motion required for one step.

Toast.Provider

查看源码
toast.Provider() *Element

Shared context coordinating related component instances.

Toast.Portal

查看源码
toast.Portal(options ...PartProps) *Element

Configures portal for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码

Toast.Viewport

查看源码
toast.Viewport(options ...ToastViewportProps) *Element

Configures viewport for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
Toastsfunc() []ToastDeclaration—

Complete declared toast queue rendered by the viewport.

func() []ToastDeclaration
查看源码
Timeoutany—

Inherited auto-dismiss duration or warm-provider timeout.

any
查看源码
Limitany—

Maximum number of notifications visible at once.

any
查看源码
Expanded*bool—

Controlled expanded tree node identifiers.

*bool
查看源码
SwipeDirectionToastSwipeDirection—

Edge toward which a swipe dismisses or moves the surface.

ToastSwipeDirection
查看源码
Pitchany—

Logical pixels of scrub motion required for one step.

any
查看源码
OnDismissfunc([]string, *native.Event)—

Reports toast identifiers dismissed by the core.

func([]string, *native.Event)
查看源码
OnStackChangefunc([]ToastStackEntry, *native.Event)—

Callback for stack change. The signature below lists the event payload.

func([]ToastStackEntry, *native.Event)
查看源码

Toast.Positioner

查看源码
toast.Positioner(options ...ToastPartProps) *Element

Configures positioner for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
ToastIDstring—

Stable queue identifier associated with one rendered toast.

string
查看源码

Toast.Root

查看源码
toast.Root(options ...ToastPartProps) *Element

Configures root for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
ToastIDstring—

Stable queue identifier associated with one rendered toast.

string
查看源码

Toast.Content

查看源码
toast.Content(options ...ToastPartProps) *Element

Configures content for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
ToastIDstring—

Stable queue identifier associated with one rendered toast.

string
查看源码

Toast.Title

查看源码
toast.Title(options ...ToastPartProps) *Element

Configures title for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
ToastIDstring—

Stable queue identifier associated with one rendered toast.

string
查看源码

Toast.Description

查看源码
toast.Description(options ...ToastPartProps) *Element

Configures description for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
ToastIDstring—

Stable queue identifier associated with one rendered toast.

string
查看源码

Toast.Action

查看源码
toast.Action(options ...ToastPartProps) *Element

Configures action for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
ToastIDstring—

Stable queue identifier associated with one rendered toast.

string
查看源码

Toast.Close

查看源码
toast.Close(options ...ToastPartProps) *Element

Configures close for this part. The declared type and source define the accepted value.

Reffunc(*native.Node)—

Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.

func(*native.Node)
查看源码
Styleany—

Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.

any
查看源码
ChildrenPartChildren—

Content mounted inside the component. Compound child callbacks run after the parent context exists.

PartChildren
查看源码
Disabledany—

Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.

any
查看源码
Rolestring—

Accessibility role override. Prefer the component’s built-in semantics.

string
查看源码
FocusOnPointerany—

Whether a pointer press moves keyboard focus to the control.

any
查看源码
Groupany—

Names this element as a group for descendant interaction-state styling.

any
查看源码
AriaLabelany—

Accessible name, especially for icon-only controls or controls without a visible label.

any
查看源码
TabIndex*float64—

Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.

*float64
查看源码
OnClickfunc(*native.Event)—

Called after QuickGUI resolves an activation, including supported keyboard activation.

func(*native.Event)
查看源码
OnDoubleClickfunc(*native.Event)—

Callback for double click. The signature below lists the event payload.

func(*native.Event)
查看源码
OnContextMenufunc(*native.Event)—

Callback for context menu. The signature below lists the event payload.

func(*native.Event)
查看源码
OnPointerfunc(*native.Event)—

Callback for pointer. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseEnterfunc(*native.Event)—

Callback for mouse enter. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseLeavefunc(*native.Event)—

Callback for mouse leave. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseDownfunc(*native.Event)—

Callback for mouse down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnMouseUpfunc(*native.Event)—

Callback for mouse up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyDownfunc(*native.Event)—

Callback for key down. The signature below lists the event payload.

func(*native.Event)
查看源码
OnKeyUpfunc(*native.Event)—

Callback for key up. The signature below lists the event payload.

func(*native.Event)
查看源码
OnFocusfunc(*native.Event)—

Callback for focus. The signature below lists the event payload.

func(*native.Event)
查看源码
OnBlurfunc(*native.Event)—

Callback for blur. The signature below lists the event payload.

func(*native.Event)
查看源码
ToastIDstring—

Stable queue identifier associated with one rendered toast.

string
查看源码
part.Child(content).Style(style)

Every part returns a fluent element. Strings, numbers, elements, and deferred child factories compose directly.

ChildChild(child any) *Element—

Child appends content and returns this element. Content can be an element, native node, scalar, accessor, or node-returning construction callback.

Child(child any) *Element
查看源码
ChildrenChildren(children ...any) *Element—

Children appends multiple children in order without replacing existing content. It also accepts []any, []*Element, and []*native.Node slices as arguments. Read the retained child nodes through element.Node.Children.

Children(children ...any) *Element
查看源码
StyleStyle(style StyleBuilder) *Element—

Style merges a reusable style. Scalar accessors retain independent native bindings.

Style(style StyleBuilder) *Element
查看源码
OnClickOnClick(handler func()) *Element—

OnClick handles a click without an unused event parameter.

OnClick(handler func()) *Element
查看源码
RefRef(handler func(*native.Node)) *Element—

Ref exposes the native handle once at this point in the declaration chain.

Ref(handler func(*native.Node)) *Element
查看源码