iframe

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

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

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

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

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

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>

func Text

func Text(str string) *element

Text Creates a new iframe element with fallback text content (HTML-encoded). Example: iframe.Text("Your browser does not support iframes.") Renders: <iframe>Your browser does not support iframes.</iframe>

func Textf

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

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

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