label

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func For

func For(forID string, str string) *element

For Creates a new label element with for attribute and text content (HTML-encoded) Example: label.For("email", "Email Address") Renders: <label for="email">Email Address</label>

func New

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

New Creates a new label element with child nodes. Example: label.New() Renders: <label></label>

func NewLabel

func NewLabel(forID string, nodes ...node.Node) *element

NewLabel Creates a new label element with for attribute and child nodes. Example: label.NewLabel("email") Renders: <label for="email"></label>

func RawText

func RawText(str string) *element

RawText Creates a new label element with raw text content as unescaped HTML Example: label.RawText("Email <em>Address</em>") Renders: <label>Email <em>Address</em></label>

func RawTextf

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

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

func Static

func Static(str string) *element

Static Creates a new label element with static text content Example: label.Static("Email Address") Renders: <label>Email Address</label>

func Text

func Text(str string) *element

Text Creates a new label element with text content (HTML-encoded) Example: label.Text("Email Address") Renders: <label>Email Address</label>

func Textf

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

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

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