modaldialog

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 3 Imported by: 0

README

ModalDialog

Modal dialog overlay with backdrop and close button.

Import

"github.com/tinywasm/components/modaldialog"

Usage

import (
    "github.com/tinywasm/components/modaldialog"
    . "github.com/tinywasm/html"
)

m := &modaldialog.ModalDialog{
    Title: "Confirm Action",
    Content: P("Are you sure?"),
}

// To open
m.Open()

Properties

  • Title (string): Modal title.
  • Content (dom.Component): Modal body content.

Methods

  • Open(): Shows the modal.

Back to Catalog

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModalDialog

type ModalDialog struct {
	Element
	Title   string
	Content Component
	// contains filtered or unexported fields
}

ModalDialog represents a modal dialog component.

func (*ModalDialog) Close added in v0.1.10

func (m *ModalDialog) Close()

Close hides the dialog programmatically — for a host that needs to dismiss it after an action completes (e.g. a confirm button), not just via the built-in backdrop/× close.

func (*ModalDialog) Init

func (m *ModalDialog) Init(_ Ctx)

func (*ModalDialog) Open

func (m *ModalDialog) Open()

func (*ModalDialog) Render

func (m *ModalDialog) Render() *Element

func (*ModalDialog) RenderCSS

func (m *ModalDialog) RenderCSS() *Stylesheet

Jump to

Keyboard shortcuts

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