div

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

New Creates a new div element with child nodes. Example: div.New(p.New(text.Text("Any kind of content here."))) Renders: <div><p>Any kind of content here.</p></div>

func RawText

func RawText(str string) *element

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

func RawTextf

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

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

func Static

func Static(str string) *element

Static Creates a new div element with static text content. Example: div.Static("Hello World") Renders: <div>Hello World</div>

func Text

func Text(str string) *element

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

func Textf

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

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

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