dialog

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 2 Imported by: 0

README

Modal Component

Dialog overlay with backdrop and close button.

Import

"github.com/tinywasm/components/modal"

Usage

m := &modal.Modal{
    Title: "Confirm Action",
    Content: dom.Tag("p").Text("Are you sure?").ToComponent(),
    Visible: false,
}

// To open
m.Open()

// To close (programmatically)
m.Close(dom.Event{})

Properties

  • Title (string): Modal title.
  • Content (dom.Component): Modal body content.
  • Visible (bool): Initial visibility state.

Methods

  • Open(): Shows the modal.
  • Close(e dom.Event): Hides the modal.

Back to Catalog

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DialogWidget

type DialogWidget struct {
	Element
	Title   string
	Content Component
	Visible bool
}

DialogWidget represents a modal dialog component.

func (*DialogWidget) Close

func (m *DialogWidget) Close(e Event)

func (*DialogWidget) IconSvg

func (m *DialogWidget) IconSvg() map[string]string

func (*DialogWidget) Open

func (m *DialogWidget) Open()

func (*DialogWidget) Render

func (m *DialogWidget) Render() *Element

func (*DialogWidget) RenderCSS

func (m *DialogWidget) RenderCSS() *Stylesheet

Jump to

Keyboard shortcuts

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