Documentation
¶
Index ¶
- func Eager(src string) *element
- func Lazy(src string) *element
- func New(nodes ...node.Node) *element
- func RawText(str string) *element
- func RawTextf(format string, args ...any) *element
- func Static(str string) *element
- func Text(str string) *element
- func Textf(format string, args ...any) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Eager ¶
func Eager(src string) *element
Eager Creates an iframe element with eager loading for immediate content display. Example: iframe.Eager("/critical-content.html") Renders: <iframe src="/critical-content.html" loading="eager"></iframe> Note: Iframe loads immediately, regardless of viewport position
func Lazy ¶
func Lazy(src string) *element
Lazy Creates an iframe element with lazy loading enabled for improved performance. Example: iframe.Lazy("/page.html") Renders: <iframe src="/page.html" loading="lazy"></iframe> Note: Iframe will only load when it enters or is near the viewport
func New ¶
New Creates a new iframe element with optional fallback content. Example: iframe.New().Src("/page.html") Renders: <iframe src="/page.html"></iframe>
func RawText ¶
func RawText(str string) *element
RawText Creates a new iframe element with raw fallback content as unescaped HTML. Example: iframe.RawText("<p>Fallback content</p>") Renders: <iframe><p>Fallback content</p></iframe>
func RawTextf ¶
RawTextf Creates a new iframe element with formatted raw text content as unescaped HTML using text.RawTextf. Example: iframe.RawTextf("Hello <em>%s</em>", "World") Renders: <iframe>Hello <em>World</em></iframe>
func Static ¶
func Static(str string) *element
Static Creates a new iframe element with static text content. Example: iframe.Static("Hello World") Renders: <iframe>Hello World</iframe>