modal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 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 Modal struct {
	*dom.Element
	Title   string
	Content dom.Component
	Visible bool
}

func (*Modal) Close

func (m *Modal) Close(e dom.Event)

func (*Modal) IconSvg

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

func (*Modal) Open

func (m *Modal) Open()

func (*Modal) Render

func (m *Modal) Render() *dom.Element

func (*Modal) RenderCSS

func (m *Modal) RenderCSS() string

Jump to

Keyboard shortcuts

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