button

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Button

func Button(str string) *element

Button Creates a generic button with text content Example: button.Button("Click Me") Renders: <button type="button">Click Me</button>

func New

func New(nodes ...node.Node) *element

New Creates a new button element with the given child nodes. Example: button.New(text.Text("Click Me")) Renders: <button>Click Me</button>

func RawText

func RawText(str string) *element

RawText Creates a new button element with raw text content as unescaped HTML. Example: button.RawText("<b>Submit</b>") Renders: <button><b>Submit</b></button>

func RawTextf

func RawTextf(format string, args ...any) *element

RawTextf Creates a new button element with formatted raw text content as unescaped HTML using text.RawTextf. Example: button.RawTextf("Hello <em>%s</em>", "World") Renders: <button>Hello <em>World</em></button>

func Reset

func Reset(str string) *element

Reset Creates a reset button with text content Example: button.Reset("Clear Form") Renders: <button type="reset">Clear Form</button>

func Static

func Static(str string) *element

Static Creates a new button element with static text content. Example: button.Static("<b>Submit</b>") Renders: <button><b>Submit</b></button>

func Submit

func Submit(str string) *element

Submit Creates a submit button with text content Example: button.Submit("Send Form") Renders: <button type="submit">Send Form</button>

func Text

func Text(str string) *element

Text Creates a new button element with text content (HTML-encoded). Example: button.Text("<b>Submit</b>") Renders: <button>&lt;b&gt;Submit&lt;/b&gt;</button>

func Textf

func Textf(format string, args ...any) *element

Textf Creates a new button element with formatted text content using text.Textf. Example: button.Textf("Hello %s", "World") Renders: <button>Hello World</button>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

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