actionbutton

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 4 Imported by: 0

README

ActionButton

Versatile button component with variant support.

Import

"github.com/tinywasm/components/actionbutton"

Usage

import "github.com/tinywasm/components/actionbutton"

btn := &actionbutton.ActionButton{
    Text: "Save Changes",
    Variant: "primary",
    OnClick: func(e dom.Event) {
        fmt.Println("Saved!")
    },
}

Properties

  • Text (string): The button label.
  • Variant (string): Visual style (primary, secondary, danger).
  • OnClick (func(dom.Event)): Click handler.

Back to Catalog

Documentation

Index

Constants

View Source
const (
	PartPrimary     = widget.Part("primary")
	PartSecondary   = widget.Part("secondary")
	PartDanger      = widget.Part("danger")
	PartUrlUp       = widget.Part("url-up")
	PartUrlDown     = widget.Part("url-down")
	PartUrl         = widget.Part("url")
	PartUrlDisable  = widget.Part("url-disable")
	PartSelected    = widget.Part("selected")
	PartLogin       = widget.Part("login")
	PartUrlPulse    = widget.Part("url-pulse")
	PartContebuton  = widget.Part("contebuton")
	PartCenteredBtn = widget.Part("centered-btn")
)
View Source
const NameActionButton = widget.Name("actionbutton")

NameActionButton is the widget name for actionbutton.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionButton

type ActionButton struct {
	Element
	Text    string
	Variant string // "primary", "secondary", "danger"
	OnClick func(Event)
}

func (*ActionButton) Render

func (b *ActionButton) Render() *Element

func (*ActionButton) Style added in v0.1.13

func (b *ActionButton) Style() *style.Sheet

Style defines the actionbutton visual contract using the style DSL.

func (*ActionButton) WidgetKind added in v0.1.13

func (b *ActionButton) WidgetKind() widget.Kind

func (*ActionButton) WidgetName added in v0.1.13

func (b *ActionButton) WidgetName() widget.Name

Jump to

Keyboard shortcuts

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