Documentation
¶
Index ¶
- Variables
- func New(nodes ...node.Node) *element
- func RawText(content string) *element
- func RawTextf(format string, args ...any) *element
- func Static(content string) *element
- func Text(content string) *element
- func Textf(format string, args ...any) *element
- func ValueMax(value float64, max float64, nodes ...node.Node) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<progress") TagClose = []byte("</progress>") AttrValue = []byte(" value=\"") AttrMax = []byte(" max=\"") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New Creates a new progress element with optional child nodes for fallback content. Example: progress.New() Renders: <progress></progress>
func RawText ¶
func RawText(content string) *element
RawText Creates a new progress element with raw fallback text content. Uses text.RawText which is not HTML-escaped. Example: progress.RawText("<span>50%</span>") Renders: <progress><span>50%</span></progress>
func RawTextf ¶
RawTextf Creates a new progress element with formatted raw fallback text content. Uses text.RawTextf which is not HTML-escaped. Example: progress.RawTextf("<strong>%d%%</strong>", pct) Renders: <progress><strong>75%</strong></progress>
func Static ¶
func Static(content string) *element
Static Creates a new progress element with static fallback text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: progress.Static("Loading...") Renders: <progress>Loading...</progress>
func Text ¶
func Text(content string) *element
Text Creates a new progress element with fallback text content. Uses text.Text which HTML-escapes the output. Example: progress.Text("50% complete") Renders: <progress>50% complete</progress>