html

package module
v0.0.0-...-f870fe0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

README

html

Type-safe HTML generation for Go, generated from WebIDL.

Go Reference

Usage

import . "github.com/imjasonh/html"

page := Div(
    P(Raw("Hello, "), T(username), Raw("!")),
    A(Raw("Click here")).Href("/home"),
    Img().Src("/logo.png").Alt("Logo"),
).Render()

This generates HTML like so:

<div><p>Hello, Jason!</p><a href="/home">Click here</a><img src="/logo.png" alt="Logo" /></div>

Features

  • Generated from WHATWG HTML Standard WebIDL
  • Type-safe attributes (bool, int, string)
  • XSS protection: T() escapes user input, Raw() for trusted HTML
  • Attr(key, value) escape hatch for arbitrary attributes
  • Automatic HTML escaping of attribute values

Generating

go run cmd/generate/main.go  # Fetches latest WebIDL and regenerates elements

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorElement

type AnchorElement[C HTMLContent] basicElement[C]

func A

func A(children ...HTMLContent) *AnchorElement[HTMLContent]

A creates a new <a> element.

func (*AnchorElement[C]) Attr

func (e *AnchorElement[C]) Attr(key, value string) *AnchorElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*AnchorElement[C]) Charset

func (e *AnchorElement[C]) Charset(v string) *AnchorElement[C]

Charset sets the charset attribute.

func (*AnchorElement[C]) Coords

func (e *AnchorElement[C]) Coords(v string) *AnchorElement[C]

Coords sets the coords attribute.

func (*AnchorElement[C]) Download

func (e *AnchorElement[C]) Download(v string) *AnchorElement[C]

Download sets the download attribute.

func (*AnchorElement[C]) Hash

func (e *AnchorElement[C]) Hash(v string) *AnchorElement[C]

Hash sets the hash attribute.

func (*AnchorElement[C]) Host

func (e *AnchorElement[C]) Host(v string) *AnchorElement[C]

Host sets the host attribute.

func (*AnchorElement[C]) Hostname

func (e *AnchorElement[C]) Hostname(v string) *AnchorElement[C]

Hostname sets the hostname attribute.

func (*AnchorElement[C]) Href

func (e *AnchorElement[C]) Href(v string) *AnchorElement[C]

Href sets the href attribute.

func (*AnchorElement[C]) Hreflang

func (e *AnchorElement[C]) Hreflang(v string) *AnchorElement[C]

Hreflang sets the hreflang attribute.

func (*AnchorElement[C]) Name

func (e *AnchorElement[C]) Name(v string) *AnchorElement[C]

Name sets the name attribute.

func (*AnchorElement[C]) Origin

func (e *AnchorElement[C]) Origin(v string) *AnchorElement[C]

Origin sets the origin attribute.

func (*AnchorElement[C]) Password

func (e *AnchorElement[C]) Password(v string) *AnchorElement[C]

Password sets the password attribute.

func (*AnchorElement[C]) Pathname

func (e *AnchorElement[C]) Pathname(v string) *AnchorElement[C]

Pathname sets the pathname attribute.

func (*AnchorElement[C]) Ping

func (e *AnchorElement[C]) Ping(v string) *AnchorElement[C]

Ping sets the ping attribute.

func (*AnchorElement[C]) Port

func (e *AnchorElement[C]) Port(v string) *AnchorElement[C]

Port sets the port attribute.

func (*AnchorElement[C]) Protocol

func (e *AnchorElement[C]) Protocol(v string) *AnchorElement[C]

Protocol sets the protocol attribute.

func (*AnchorElement[C]) ReferrerPolicy

func (e *AnchorElement[C]) ReferrerPolicy(v string) *AnchorElement[C]

ReferrerPolicy sets the referrerPolicy attribute.

func (*AnchorElement[C]) Rel

func (e *AnchorElement[C]) Rel(v string) *AnchorElement[C]

Rel sets the rel attribute.

func (*AnchorElement[C]) RelList

func (e *AnchorElement[C]) RelList(v string) *AnchorElement[C]

RelList sets the relList attribute.

func (*AnchorElement[C]) Render

func (e *AnchorElement[C]) Render() string

Render returns the HTML string representation.

func (*AnchorElement[C]) Rev

func (e *AnchorElement[C]) Rev(v string) *AnchorElement[C]

Rev sets the rev attribute.

func (*AnchorElement[C]) Search

func (e *AnchorElement[C]) Search(v string) *AnchorElement[C]

Search sets the search attribute.

func (*AnchorElement[C]) Shape

func (e *AnchorElement[C]) Shape(v string) *AnchorElement[C]

Shape sets the shape attribute.

func (*AnchorElement[C]) Target

func (e *AnchorElement[C]) Target(v string) *AnchorElement[C]

Target sets the target attribute.

func (*AnchorElement[C]) Text

func (e *AnchorElement[C]) Text(v string) *AnchorElement[C]

Text sets the text attribute.

func (*AnchorElement[C]) Type

func (e *AnchorElement[C]) Type(v string) *AnchorElement[C]

Type sets the type attribute.

func (*AnchorElement[C]) Username

func (e *AnchorElement[C]) Username(v string) *AnchorElement[C]

Username sets the username attribute.

type AreaElement

type AreaElement basicElement[HTMLContent]

func Area

func Area() *AreaElement

Area creates a new <area> element.

func (*AreaElement) Alt

func (e *AreaElement) Alt(v string) *AreaElement

Alt sets the alt attribute.

func (*AreaElement) Attr

func (e *AreaElement) Attr(key, value string) *AreaElement

Attr sets an arbitrary attribute as an escape hatch.

func (*AreaElement) Coords

func (e *AreaElement) Coords(v string) *AreaElement

Coords sets the coords attribute.

func (*AreaElement) Download

func (e *AreaElement) Download(v string) *AreaElement

Download sets the download attribute.

func (*AreaElement) Hash

func (e *AreaElement) Hash(v string) *AreaElement

Hash sets the hash attribute.

func (*AreaElement) Host

func (e *AreaElement) Host(v string) *AreaElement

Host sets the host attribute.

func (*AreaElement) Hostname

func (e *AreaElement) Hostname(v string) *AreaElement

Hostname sets the hostname attribute.

func (*AreaElement) Href

func (e *AreaElement) Href(v string) *AreaElement

Href sets the href attribute.

func (*AreaElement) NoHref

func (e *AreaElement) NoHref(v bool) *AreaElement

NoHref sets the noHref attribute.

func (*AreaElement) Origin

func (e *AreaElement) Origin(v string) *AreaElement

Origin sets the origin attribute.

func (*AreaElement) Password

func (e *AreaElement) Password(v string) *AreaElement

Password sets the password attribute.

func (*AreaElement) Pathname

func (e *AreaElement) Pathname(v string) *AreaElement

Pathname sets the pathname attribute.

func (*AreaElement) Ping

func (e *AreaElement) Ping(v string) *AreaElement

Ping sets the ping attribute.

func (*AreaElement) Port

func (e *AreaElement) Port(v string) *AreaElement

Port sets the port attribute.

func (*AreaElement) Protocol

func (e *AreaElement) Protocol(v string) *AreaElement

Protocol sets the protocol attribute.

func (*AreaElement) ReferrerPolicy

func (e *AreaElement) ReferrerPolicy(v string) *AreaElement

ReferrerPolicy sets the referrerPolicy attribute.

func (*AreaElement) Rel

func (e *AreaElement) Rel(v string) *AreaElement

Rel sets the rel attribute.

func (*AreaElement) RelList

func (e *AreaElement) RelList(v string) *AreaElement

RelList sets the relList attribute.

func (*AreaElement) Render

func (e *AreaElement) Render() string

Render returns the HTML string representation.

func (*AreaElement) Search

func (e *AreaElement) Search(v string) *AreaElement

Search sets the search attribute.

func (*AreaElement) Shape

func (e *AreaElement) Shape(v string) *AreaElement

Shape sets the shape attribute.

func (*AreaElement) Target

func (e *AreaElement) Target(v string) *AreaElement

Target sets the target attribute.

func (*AreaElement) Username

func (e *AreaElement) Username(v string) *AreaElement

Username sets the username attribute.

type Attribute

type Attribute struct {
	Key   string
	Value string
}

Attribute represents a single key/value HTML attribute for internal storage.

type BRElement

type BRElement basicElement[HTMLContent]

func Br

func Br() *BRElement

Br creates a new <br> element.

func (*BRElement) Attr

func (e *BRElement) Attr(key, value string) *BRElement

Attr sets an arbitrary attribute as an escape hatch.

func (*BRElement) Clear

func (e *BRElement) Clear(v string) *BRElement

Clear sets the clear attribute.

func (*BRElement) Render

func (e *BRElement) Render() string

Render returns the HTML string representation.

type BaseElement

type BaseElement basicElement[HTMLContent]

func Base

func Base() *BaseElement

Base creates a new <base> element.

func (*BaseElement) Attr

func (e *BaseElement) Attr(key, value string) *BaseElement

Attr sets an arbitrary attribute as an escape hatch.

func (*BaseElement) Href

func (e *BaseElement) Href(v string) *BaseElement

Href sets the href attribute.

func (*BaseElement) Render

func (e *BaseElement) Render() string

Render returns the HTML string representation.

func (*BaseElement) Target

func (e *BaseElement) Target(v string) *BaseElement

Target sets the target attribute.

type BodyElement

type BodyElement[C HTMLContent] basicElement[C]

func Body

func Body(children ...HTMLContent) *BodyElement[HTMLContent]

Body creates a new <body> element.

func (*BodyElement[C]) Attr

func (e *BodyElement[C]) Attr(key, value string) *BodyElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*BodyElement[C]) Background

func (e *BodyElement[C]) Background(v string) *BodyElement[C]

Background sets the background attribute.

func (*BodyElement[C]) Onafterprint

func (e *BodyElement[C]) Onafterprint(v string) *BodyElement[C]

Onafterprint sets the onafterprint attribute.

func (*BodyElement[C]) Onbeforeprint

func (e *BodyElement[C]) Onbeforeprint(v string) *BodyElement[C]

Onbeforeprint sets the onbeforeprint attribute.

func (*BodyElement[C]) Onbeforeunload

func (e *BodyElement[C]) Onbeforeunload(v string) *BodyElement[C]

Onbeforeunload sets the onbeforeunload attribute.

func (*BodyElement[C]) Onhashchange

func (e *BodyElement[C]) Onhashchange(v string) *BodyElement[C]

Onhashchange sets the onhashchange attribute.

func (*BodyElement[C]) Onlanguagechange

func (e *BodyElement[C]) Onlanguagechange(v string) *BodyElement[C]

Onlanguagechange sets the onlanguagechange attribute.

func (*BodyElement[C]) Onmessage

func (e *BodyElement[C]) Onmessage(v string) *BodyElement[C]

Onmessage sets the onmessage attribute.

func (*BodyElement[C]) Onmessageerror

func (e *BodyElement[C]) Onmessageerror(v string) *BodyElement[C]

Onmessageerror sets the onmessageerror attribute.

func (*BodyElement[C]) Onoffline

func (e *BodyElement[C]) Onoffline(v string) *BodyElement[C]

Onoffline sets the onoffline attribute.

func (*BodyElement[C]) Ononline

func (e *BodyElement[C]) Ononline(v string) *BodyElement[C]

Ononline sets the ononline attribute.

func (*BodyElement[C]) Onpagehide

func (e *BodyElement[C]) Onpagehide(v string) *BodyElement[C]

Onpagehide sets the onpagehide attribute.

func (*BodyElement[C]) Onpagereveal

func (e *BodyElement[C]) Onpagereveal(v string) *BodyElement[C]

Onpagereveal sets the onpagereveal attribute.

func (*BodyElement[C]) Onpageshow

func (e *BodyElement[C]) Onpageshow(v string) *BodyElement[C]

Onpageshow sets the onpageshow attribute.

func (*BodyElement[C]) Onpageswap

func (e *BodyElement[C]) Onpageswap(v string) *BodyElement[C]

Onpageswap sets the onpageswap attribute.

func (*BodyElement[C]) Onpopstate

func (e *BodyElement[C]) Onpopstate(v string) *BodyElement[C]

Onpopstate sets the onpopstate attribute.

func (*BodyElement[C]) Onrejectionhandled

func (e *BodyElement[C]) Onrejectionhandled(v string) *BodyElement[C]

Onrejectionhandled sets the onrejectionhandled attribute.

func (*BodyElement[C]) Onstorage

func (e *BodyElement[C]) Onstorage(v string) *BodyElement[C]

Onstorage sets the onstorage attribute.

func (*BodyElement[C]) Onunhandledrejection

func (e *BodyElement[C]) Onunhandledrejection(v string) *BodyElement[C]

Onunhandledrejection sets the onunhandledrejection attribute.

func (*BodyElement[C]) Onunload

func (e *BodyElement[C]) Onunload(v string) *BodyElement[C]

Onunload sets the onunload attribute.

func (*BodyElement[C]) Render

func (e *BodyElement[C]) Render() string

Render returns the HTML string representation.

type ButtonElement

type ButtonElement[C HTMLContent] basicElement[C]

func Button

func Button(children ...HTMLContent) *ButtonElement[HTMLContent]

Button creates a new <button> element.

func (*ButtonElement[C]) Attr

func (e *ButtonElement[C]) Attr(key, value string) *ButtonElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*ButtonElement[C]) Command

func (e *ButtonElement[C]) Command(v string) *ButtonElement[C]

Command sets the command attribute.

func (*ButtonElement[C]) Disabled

func (e *ButtonElement[C]) Disabled(v bool) *ButtonElement[C]

Disabled sets the disabled attribute.

func (*ButtonElement[C]) FormAction

func (e *ButtonElement[C]) FormAction(v string) *ButtonElement[C]

FormAction sets the formAction attribute.

func (*ButtonElement[C]) FormEnctype

func (e *ButtonElement[C]) FormEnctype(v string) *ButtonElement[C]

FormEnctype sets the formEnctype attribute.

func (*ButtonElement[C]) FormMethod

func (e *ButtonElement[C]) FormMethod(v string) *ButtonElement[C]

FormMethod sets the formMethod attribute.

func (*ButtonElement[C]) FormNoValidate

func (e *ButtonElement[C]) FormNoValidate(v bool) *ButtonElement[C]

FormNoValidate sets the formNoValidate attribute.

func (*ButtonElement[C]) FormTarget

func (e *ButtonElement[C]) FormTarget(v string) *ButtonElement[C]

FormTarget sets the formTarget attribute.

func (*ButtonElement[C]) Labels

func (e *ButtonElement[C]) Labels(v string) *ButtonElement[C]

Labels sets the labels attribute.

func (*ButtonElement[C]) Name

func (e *ButtonElement[C]) Name(v string) *ButtonElement[C]

Name sets the name attribute.

func (*ButtonElement[C]) PopoverTargetAction

func (e *ButtonElement[C]) PopoverTargetAction(v string) *ButtonElement[C]

PopoverTargetAction sets the popoverTargetAction attribute.

func (*ButtonElement[C]) Render

func (e *ButtonElement[C]) Render() string

Render returns the HTML string representation.

func (*ButtonElement[C]) Type

func (e *ButtonElement[C]) Type(v string) *ButtonElement[C]

Type sets the type attribute.

func (*ButtonElement[C]) ValidationMessage

func (e *ButtonElement[C]) ValidationMessage(v string) *ButtonElement[C]

ValidationMessage sets the validationMessage attribute.

func (*ButtonElement[C]) Validity

func (e *ButtonElement[C]) Validity(v string) *ButtonElement[C]

Validity sets the validity attribute.

func (*ButtonElement[C]) Value

func (e *ButtonElement[C]) Value(v string) *ButtonElement[C]

Value sets the value attribute.

func (*ButtonElement[C]) WillValidate

func (e *ButtonElement[C]) WillValidate(v bool) *ButtonElement[C]

WillValidate sets the willValidate attribute.

type CanvasElement

type CanvasElement[C HTMLContent] basicElement[C]

func Canvas

func Canvas(children ...HTMLContent) *CanvasElement[HTMLContent]

Canvas creates a new <canvas> element.

func (*CanvasElement[C]) Attr

func (e *CanvasElement[C]) Attr(key, value string) *CanvasElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*CanvasElement[C]) Render

func (e *CanvasElement[C]) Render() string

Render returns the HTML string representation.

type DListElement

type DListElement[C HTMLContent] basicElement[C]

func Dl

func Dl(children ...HTMLContent) *DListElement[HTMLContent]

Dl creates a new <dl> element.

func (*DListElement[C]) Attr

func (e *DListElement[C]) Attr(key, value string) *DListElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*DListElement[C]) Compact

func (e *DListElement[C]) Compact(v bool) *DListElement[C]

Compact sets the compact attribute.

func (*DListElement[C]) Render

func (e *DListElement[C]) Render() string

Render returns the HTML string representation.

type DataElement

type DataElement[C HTMLContent] basicElement[C]

func Data

func Data(children ...HTMLContent) *DataElement[HTMLContent]

Data creates a new <data> element.

func (*DataElement[C]) Attr

func (e *DataElement[C]) Attr(key, value string) *DataElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*DataElement[C]) Render

func (e *DataElement[C]) Render() string

Render returns the HTML string representation.

func (*DataElement[C]) Value

func (e *DataElement[C]) Value(v string) *DataElement[C]

Value sets the value attribute.

type DataListElement

type DataListElement[C HTMLContent] basicElement[C]

func Datalist

func Datalist(children ...HTMLContent) *DataListElement[HTMLContent]

Datalist creates a new <datalist> element.

func (*DataListElement[C]) Attr

func (e *DataListElement[C]) Attr(key, value string) *DataListElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*DataListElement[C]) Options

func (e *DataListElement[C]) Options(v string) *DataListElement[C]

Options sets the options attribute.

func (*DataListElement[C]) Render

func (e *DataListElement[C]) Render() string

Render returns the HTML string representation.

type DetailsElement

type DetailsElement[C HTMLContent] basicElement[C]

func Details

func Details(children ...HTMLContent) *DetailsElement[HTMLContent]

Details creates a new <details> element.

func (*DetailsElement[C]) Attr

func (e *DetailsElement[C]) Attr(key, value string) *DetailsElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*DetailsElement[C]) Name

func (e *DetailsElement[C]) Name(v string) *DetailsElement[C]

Name sets the name attribute.

func (*DetailsElement[C]) Open

func (e *DetailsElement[C]) Open(v bool) *DetailsElement[C]

Open sets the open attribute.

func (*DetailsElement[C]) Render

func (e *DetailsElement[C]) Render() string

Render returns the HTML string representation.

type DialogElement

type DialogElement[C HTMLContent] basicElement[C]

func Dialog

func Dialog(children ...HTMLContent) *DialogElement[HTMLContent]

Dialog creates a new <dialog> element.

func (*DialogElement[C]) Attr

func (e *DialogElement[C]) Attr(key, value string) *DialogElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*DialogElement[C]) ClosedBy

func (e *DialogElement[C]) ClosedBy(v string) *DialogElement[C]

ClosedBy sets the closedBy attribute.

func (*DialogElement[C]) Open

func (e *DialogElement[C]) Open(v bool) *DialogElement[C]

Open sets the open attribute.

func (*DialogElement[C]) Render

func (e *DialogElement[C]) Render() string

Render returns the HTML string representation.

func (*DialogElement[C]) ReturnValue

func (e *DialogElement[C]) ReturnValue(v string) *DialogElement[C]

ReturnValue sets the returnValue attribute.

type DirectoryElement

type DirectoryElement[C HTMLContent] basicElement[C]

func Dir

func Dir(children ...HTMLContent) *DirectoryElement[HTMLContent]

Dir creates a new <dir> element.

func (*DirectoryElement[C]) Attr

func (e *DirectoryElement[C]) Attr(key, value string) *DirectoryElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*DirectoryElement[C]) Compact

func (e *DirectoryElement[C]) Compact(v bool) *DirectoryElement[C]

Compact sets the compact attribute.

func (*DirectoryElement[C]) Render

func (e *DirectoryElement[C]) Render() string

Render returns the HTML string representation.

type DivElement

type DivElement[C HTMLContent] basicElement[C]

func Div

func Div(children ...HTMLContent) *DivElement[HTMLContent]

Div creates a new <div> element.

func (*DivElement[C]) Align

func (e *DivElement[C]) Align(v string) *DivElement[C]

Align sets the align attribute.

func (*DivElement[C]) Attr

func (e *DivElement[C]) Attr(key, value string) *DivElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*DivElement[C]) Render

func (e *DivElement[C]) Render() string

Render returns the HTML string representation.

type EmbedElement

type EmbedElement basicElement[HTMLContent]

func Embed

func Embed() *EmbedElement

Embed creates a new <embed> element.

func (*EmbedElement) Align

func (e *EmbedElement) Align(v string) *EmbedElement

Align sets the align attribute.

func (*EmbedElement) Attr

func (e *EmbedElement) Attr(key, value string) *EmbedElement

Attr sets an arbitrary attribute as an escape hatch.

func (*EmbedElement) Height

func (e *EmbedElement) Height(v string) *EmbedElement

Height sets the height attribute.

func (*EmbedElement) Name

func (e *EmbedElement) Name(v string) *EmbedElement

Name sets the name attribute.

func (*EmbedElement) Render

func (e *EmbedElement) Render() string

Render returns the HTML string representation.

func (*EmbedElement) Src

func (e *EmbedElement) Src(v string) *EmbedElement

Src sets the src attribute.

func (*EmbedElement) Type

func (e *EmbedElement) Type(v string) *EmbedElement

Type sets the type attribute.

func (*EmbedElement) Width

func (e *EmbedElement) Width(v string) *EmbedElement

Width sets the width attribute.

type FieldSetElement

type FieldSetElement[C HTMLContent] basicElement[C]

func Fieldset

func Fieldset(children ...HTMLContent) *FieldSetElement[HTMLContent]

Fieldset creates a new <fieldset> element.

func (*FieldSetElement[C]) Attr

func (e *FieldSetElement[C]) Attr(key, value string) *FieldSetElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*FieldSetElement[C]) Disabled

func (e *FieldSetElement[C]) Disabled(v bool) *FieldSetElement[C]

Disabled sets the disabled attribute.

func (*FieldSetElement[C]) Elements

func (e *FieldSetElement[C]) Elements(v string) *FieldSetElement[C]

Elements sets the elements attribute.

func (*FieldSetElement[C]) Name

func (e *FieldSetElement[C]) Name(v string) *FieldSetElement[C]

Name sets the name attribute.

func (*FieldSetElement[C]) Render

func (e *FieldSetElement[C]) Render() string

Render returns the HTML string representation.

func (*FieldSetElement[C]) Type

func (e *FieldSetElement[C]) Type(v string) *FieldSetElement[C]

Type sets the type attribute.

func (*FieldSetElement[C]) ValidationMessage

func (e *FieldSetElement[C]) ValidationMessage(v string) *FieldSetElement[C]

ValidationMessage sets the validationMessage attribute.

func (*FieldSetElement[C]) Validity

func (e *FieldSetElement[C]) Validity(v string) *FieldSetElement[C]

Validity sets the validity attribute.

func (*FieldSetElement[C]) WillValidate

func (e *FieldSetElement[C]) WillValidate(v bool) *FieldSetElement[C]

WillValidate sets the willValidate attribute.

type FontElement

type FontElement[C HTMLContent] basicElement[C]

func Font

func Font(children ...HTMLContent) *FontElement[HTMLContent]

Font creates a new <font> element.

func (*FontElement[C]) Attr

func (e *FontElement[C]) Attr(key, value string) *FontElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*FontElement[C]) Face

func (e *FontElement[C]) Face(v string) *FontElement[C]

Face sets the face attribute.

func (*FontElement[C]) Render

func (e *FontElement[C]) Render() string

Render returns the HTML string representation.

func (*FontElement[C]) Size

func (e *FontElement[C]) Size(v string) *FontElement[C]

Size sets the size attribute.

type FormElement

type FormElement[C HTMLContent] basicElement[C]

func Form

func Form(children ...HTMLContent) *FormElement[HTMLContent]

Form creates a new <form> element.

func (*FormElement[C]) AcceptCharset

func (e *FormElement[C]) AcceptCharset(v string) *FormElement[C]

AcceptCharset sets the acceptCharset attribute.

func (*FormElement[C]) Action

func (e *FormElement[C]) Action(v string) *FormElement[C]

Action sets the action attribute.

func (*FormElement[C]) Attr

func (e *FormElement[C]) Attr(key, value string) *FormElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*FormElement[C]) Autocomplete

func (e *FormElement[C]) Autocomplete(v string) *FormElement[C]

Autocomplete sets the autocomplete attribute.

func (*FormElement[C]) Elements

func (e *FormElement[C]) Elements(v string) *FormElement[C]

Elements sets the elements attribute.

func (*FormElement[C]) Encoding

func (e *FormElement[C]) Encoding(v string) *FormElement[C]

Encoding sets the encoding attribute.

func (*FormElement[C]) Enctype

func (e *FormElement[C]) Enctype(v string) *FormElement[C]

Enctype sets the enctype attribute.

func (*FormElement[C]) Method

func (e *FormElement[C]) Method(v string) *FormElement[C]

Method sets the method attribute.

func (*FormElement[C]) Name

func (e *FormElement[C]) Name(v string) *FormElement[C]

Name sets the name attribute.

func (*FormElement[C]) NoValidate

func (e *FormElement[C]) NoValidate(v bool) *FormElement[C]

NoValidate sets the noValidate attribute.

func (*FormElement[C]) Rel

func (e *FormElement[C]) Rel(v string) *FormElement[C]

Rel sets the rel attribute.

func (*FormElement[C]) RelList

func (e *FormElement[C]) RelList(v string) *FormElement[C]

RelList sets the relList attribute.

func (*FormElement[C]) Render

func (e *FormElement[C]) Render() string

Render returns the HTML string representation.

func (*FormElement[C]) Target

func (e *FormElement[C]) Target(v string) *FormElement[C]

Target sets the target attribute.

type FrameElement

type FrameElement[C HTMLContent] basicElement[C]

func Frame

func Frame(children ...HTMLContent) *FrameElement[HTMLContent]

Frame creates a new <frame> element.

func (*FrameElement[C]) Attr

func (e *FrameElement[C]) Attr(key, value string) *FrameElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*FrameElement[C]) FrameBorder

func (e *FrameElement[C]) FrameBorder(v string) *FrameElement[C]

FrameBorder sets the frameBorder attribute.

func (*FrameElement[C]) LongDesc

func (e *FrameElement[C]) LongDesc(v string) *FrameElement[C]

LongDesc sets the longDesc attribute.

func (*FrameElement[C]) Name

func (e *FrameElement[C]) Name(v string) *FrameElement[C]

Name sets the name attribute.

func (*FrameElement[C]) NoResize

func (e *FrameElement[C]) NoResize(v bool) *FrameElement[C]

NoResize sets the noResize attribute.

func (*FrameElement[C]) Render

func (e *FrameElement[C]) Render() string

Render returns the HTML string representation.

func (*FrameElement[C]) Scrolling

func (e *FrameElement[C]) Scrolling(v string) *FrameElement[C]

Scrolling sets the scrolling attribute.

func (*FrameElement[C]) Src

func (e *FrameElement[C]) Src(v string) *FrameElement[C]

Src sets the src attribute.

type FrameSetElement

type FrameSetElement[C HTMLContent] basicElement[C]

func Frameset

func Frameset(children ...HTMLContent) *FrameSetElement[HTMLContent]

Frameset creates a new <frameset> element.

func (*FrameSetElement[C]) Attr

func (e *FrameSetElement[C]) Attr(key, value string) *FrameSetElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*FrameSetElement[C]) Cols

func (e *FrameSetElement[C]) Cols(v string) *FrameSetElement[C]

Cols sets the cols attribute.

func (*FrameSetElement[C]) Onafterprint

func (e *FrameSetElement[C]) Onafterprint(v string) *FrameSetElement[C]

Onafterprint sets the onafterprint attribute.

func (*FrameSetElement[C]) Onbeforeprint

func (e *FrameSetElement[C]) Onbeforeprint(v string) *FrameSetElement[C]

Onbeforeprint sets the onbeforeprint attribute.

func (*FrameSetElement[C]) Onbeforeunload

func (e *FrameSetElement[C]) Onbeforeunload(v string) *FrameSetElement[C]

Onbeforeunload sets the onbeforeunload attribute.

func (*FrameSetElement[C]) Onhashchange

func (e *FrameSetElement[C]) Onhashchange(v string) *FrameSetElement[C]

Onhashchange sets the onhashchange attribute.

func (*FrameSetElement[C]) Onlanguagechange

func (e *FrameSetElement[C]) Onlanguagechange(v string) *FrameSetElement[C]

Onlanguagechange sets the onlanguagechange attribute.

func (*FrameSetElement[C]) Onmessage

func (e *FrameSetElement[C]) Onmessage(v string) *FrameSetElement[C]

Onmessage sets the onmessage attribute.

func (*FrameSetElement[C]) Onmessageerror

func (e *FrameSetElement[C]) Onmessageerror(v string) *FrameSetElement[C]

Onmessageerror sets the onmessageerror attribute.

func (*FrameSetElement[C]) Onoffline

func (e *FrameSetElement[C]) Onoffline(v string) *FrameSetElement[C]

Onoffline sets the onoffline attribute.

func (*FrameSetElement[C]) Ononline

func (e *FrameSetElement[C]) Ononline(v string) *FrameSetElement[C]

Ononline sets the ononline attribute.

func (*FrameSetElement[C]) Onpagehide

func (e *FrameSetElement[C]) Onpagehide(v string) *FrameSetElement[C]

Onpagehide sets the onpagehide attribute.

func (*FrameSetElement[C]) Onpagereveal

func (e *FrameSetElement[C]) Onpagereveal(v string) *FrameSetElement[C]

Onpagereveal sets the onpagereveal attribute.

func (*FrameSetElement[C]) Onpageshow

func (e *FrameSetElement[C]) Onpageshow(v string) *FrameSetElement[C]

Onpageshow sets the onpageshow attribute.

func (*FrameSetElement[C]) Onpageswap

func (e *FrameSetElement[C]) Onpageswap(v string) *FrameSetElement[C]

Onpageswap sets the onpageswap attribute.

func (*FrameSetElement[C]) Onpopstate

func (e *FrameSetElement[C]) Onpopstate(v string) *FrameSetElement[C]

Onpopstate sets the onpopstate attribute.

func (*FrameSetElement[C]) Onrejectionhandled

func (e *FrameSetElement[C]) Onrejectionhandled(v string) *FrameSetElement[C]

Onrejectionhandled sets the onrejectionhandled attribute.

func (*FrameSetElement[C]) Onstorage

func (e *FrameSetElement[C]) Onstorage(v string) *FrameSetElement[C]

Onstorage sets the onstorage attribute.

func (*FrameSetElement[C]) Onunhandledrejection

func (e *FrameSetElement[C]) Onunhandledrejection(v string) *FrameSetElement[C]

Onunhandledrejection sets the onunhandledrejection attribute.

func (*FrameSetElement[C]) Onunload

func (e *FrameSetElement[C]) Onunload(v string) *FrameSetElement[C]

Onunload sets the onunload attribute.

func (*FrameSetElement[C]) Render

func (e *FrameSetElement[C]) Render() string

Render returns the HTML string representation.

func (*FrameSetElement[C]) Rows

func (e *FrameSetElement[C]) Rows(v string) *FrameSetElement[C]

Rows sets the rows attribute.

type HRElement

type HRElement basicElement[HTMLContent]

func Hr

func Hr() *HRElement

Hr creates a new <hr> element.

func (*HRElement) Align

func (e *HRElement) Align(v string) *HRElement

Align sets the align attribute.

func (*HRElement) Attr

func (e *HRElement) Attr(key, value string) *HRElement

Attr sets an arbitrary attribute as an escape hatch.

func (*HRElement) Color

func (e *HRElement) Color(v string) *HRElement

Color sets the color attribute.

func (*HRElement) NoShade

func (e *HRElement) NoShade(v bool) *HRElement

NoShade sets the noShade attribute.

func (*HRElement) Render

func (e *HRElement) Render() string

Render returns the HTML string representation.

func (*HRElement) Size

func (e *HRElement) Size(v string) *HRElement

Size sets the size attribute.

func (*HRElement) Width

func (e *HRElement) Width(v string) *HRElement

Width sets the width attribute.

type HTMLContent

type HTMLContent interface {
	// Render returns the HTML string representation of the content.
	Render() string
}

HTMLContent is the core interface for anything that can be rendered as part of the document.

type HeadElement

type HeadElement[C HTMLContent] basicElement[C]
func Head(children ...HTMLContent) *HeadElement[HTMLContent]

Head creates a new <head> element.

func (*HeadElement[C]) Attr

func (e *HeadElement[C]) Attr(key, value string) *HeadElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*HeadElement[C]) Render

func (e *HeadElement[C]) Render() string

Render returns the HTML string representation.

type HtmlElement

type HtmlElement[C HTMLContent] basicElement[C]

func Html

func Html(children ...HTMLContent) *HtmlElement[HTMLContent]

Html creates a new <html> element.

func (*HtmlElement[C]) Attr

func (e *HtmlElement[C]) Attr(key, value string) *HtmlElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*HtmlElement[C]) Render

func (e *HtmlElement[C]) Render() string

Render returns the HTML string representation.

func (*HtmlElement[C]) Version

func (e *HtmlElement[C]) Version(v string) *HtmlElement[C]

Version sets the version attribute.

type IFrameElement

type IFrameElement[C HTMLContent] basicElement[C]

func Iframe

func Iframe(children ...HTMLContent) *IFrameElement[HTMLContent]

Iframe creates a new <iframe> element.

func (*IFrameElement[C]) Align

func (e *IFrameElement[C]) Align(v string) *IFrameElement[C]

Align sets the align attribute.

func (*IFrameElement[C]) Allow

func (e *IFrameElement[C]) Allow(v string) *IFrameElement[C]

Allow sets the allow attribute.

func (*IFrameElement[C]) AllowFullscreen

func (e *IFrameElement[C]) AllowFullscreen(v bool) *IFrameElement[C]

AllowFullscreen sets the allowFullscreen attribute.

func (*IFrameElement[C]) Attr

func (e *IFrameElement[C]) Attr(key, value string) *IFrameElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*IFrameElement[C]) FrameBorder

func (e *IFrameElement[C]) FrameBorder(v string) *IFrameElement[C]

FrameBorder sets the frameBorder attribute.

func (*IFrameElement[C]) Height

func (e *IFrameElement[C]) Height(v string) *IFrameElement[C]

Height sets the height attribute.

func (*IFrameElement[C]) Loading

func (e *IFrameElement[C]) Loading(v string) *IFrameElement[C]

Loading sets the loading attribute.

func (*IFrameElement[C]) LongDesc

func (e *IFrameElement[C]) LongDesc(v string) *IFrameElement[C]

LongDesc sets the longDesc attribute.

func (*IFrameElement[C]) Name

func (e *IFrameElement[C]) Name(v string) *IFrameElement[C]

Name sets the name attribute.

func (*IFrameElement[C]) ReferrerPolicy

func (e *IFrameElement[C]) ReferrerPolicy(v string) *IFrameElement[C]

ReferrerPolicy sets the referrerPolicy attribute.

func (*IFrameElement[C]) Render

func (e *IFrameElement[C]) Render() string

Render returns the HTML string representation.

func (*IFrameElement[C]) Sandbox

func (e *IFrameElement[C]) Sandbox(v string) *IFrameElement[C]

Sandbox sets the sandbox attribute.

func (*IFrameElement[C]) Scrolling

func (e *IFrameElement[C]) Scrolling(v string) *IFrameElement[C]

Scrolling sets the scrolling attribute.

func (*IFrameElement[C]) Src

func (e *IFrameElement[C]) Src(v string) *IFrameElement[C]

Src sets the src attribute.

func (*IFrameElement[C]) Width

func (e *IFrameElement[C]) Width(v string) *IFrameElement[C]

Width sets the width attribute.

type ImageElement

type ImageElement basicElement[HTMLContent]

func Img

func Img() *ImageElement

Img creates a new <img> element.

func (*ImageElement) Align

func (e *ImageElement) Align(v string) *ImageElement

Align sets the align attribute.

func (*ImageElement) Alt

func (e *ImageElement) Alt(v string) *ImageElement

Alt sets the alt attribute.

func (*ImageElement) Attr

func (e *ImageElement) Attr(key, value string) *ImageElement

Attr sets an arbitrary attribute as an escape hatch.

func (*ImageElement) Complete

func (e *ImageElement) Complete(v bool) *ImageElement

Complete sets the complete attribute.

func (*ImageElement) CurrentSrc

func (e *ImageElement) CurrentSrc(v string) *ImageElement

CurrentSrc sets the currentSrc attribute.

func (*ImageElement) Decoding

func (e *ImageElement) Decoding(v string) *ImageElement

Decoding sets the decoding attribute.

func (*ImageElement) FetchPriority

func (e *ImageElement) FetchPriority(v string) *ImageElement

FetchPriority sets the fetchPriority attribute.

func (*ImageElement) IsMap

func (e *ImageElement) IsMap(v bool) *ImageElement

IsMap sets the isMap attribute.

func (*ImageElement) Loading

func (e *ImageElement) Loading(v string) *ImageElement

Loading sets the loading attribute.

func (*ImageElement) LongDesc

func (e *ImageElement) LongDesc(v string) *ImageElement

LongDesc sets the longDesc attribute.

func (*ImageElement) Lowsrc

func (e *ImageElement) Lowsrc(v string) *ImageElement

Lowsrc sets the lowsrc attribute.

func (*ImageElement) Name

func (e *ImageElement) Name(v string) *ImageElement

Name sets the name attribute.

func (*ImageElement) ReferrerPolicy

func (e *ImageElement) ReferrerPolicy(v string) *ImageElement

ReferrerPolicy sets the referrerPolicy attribute.

func (*ImageElement) Render

func (e *ImageElement) Render() string

Render returns the HTML string representation.

func (*ImageElement) Sizes

func (e *ImageElement) Sizes(v string) *ImageElement

Sizes sets the sizes attribute.

func (*ImageElement) Src

func (e *ImageElement) Src(v string) *ImageElement

Src sets the src attribute.

func (*ImageElement) Srcset

func (e *ImageElement) Srcset(v string) *ImageElement

Srcset sets the srcset attribute.

func (*ImageElement) UseMap

func (e *ImageElement) UseMap(v string) *ImageElement

UseMap sets the useMap attribute.

type InputElement

type InputElement basicElement[HTMLContent]

func Input

func Input() *InputElement

Input creates a new <input> element.

func (*InputElement) Accept

func (e *InputElement) Accept(v string) *InputElement

Accept sets the accept attribute.

func (*InputElement) Align

func (e *InputElement) Align(v string) *InputElement

Align sets the align attribute.

func (*InputElement) Alpha

func (e *InputElement) Alpha(v bool) *InputElement

Alpha sets the alpha attribute.

func (*InputElement) Alt

func (e *InputElement) Alt(v string) *InputElement

Alt sets the alt attribute.

func (*InputElement) Attr

func (e *InputElement) Attr(key, value string) *InputElement

Attr sets an arbitrary attribute as an escape hatch.

func (*InputElement) Autocomplete

func (e *InputElement) Autocomplete(v string) *InputElement

Autocomplete sets the autocomplete attribute.

func (*InputElement) Checked

func (e *InputElement) Checked(v bool) *InputElement

Checked sets the checked attribute.

func (*InputElement) ColorSpace

func (e *InputElement) ColorSpace(v string) *InputElement

ColorSpace sets the colorSpace attribute.

func (*InputElement) DefaultChecked

func (e *InputElement) DefaultChecked(v bool) *InputElement

DefaultChecked sets the defaultChecked attribute.

func (*InputElement) DefaultValue

func (e *InputElement) DefaultValue(v string) *InputElement

DefaultValue sets the defaultValue attribute.

func (*InputElement) DirName

func (e *InputElement) DirName(v string) *InputElement

DirName sets the dirName attribute.

func (*InputElement) Disabled

func (e *InputElement) Disabled(v bool) *InputElement

Disabled sets the disabled attribute.

func (*InputElement) FormAction

func (e *InputElement) FormAction(v string) *InputElement

FormAction sets the formAction attribute.

func (*InputElement) FormEnctype

func (e *InputElement) FormEnctype(v string) *InputElement

FormEnctype sets the formEnctype attribute.

func (*InputElement) FormMethod

func (e *InputElement) FormMethod(v string) *InputElement

FormMethod sets the formMethod attribute.

func (*InputElement) FormNoValidate

func (e *InputElement) FormNoValidate(v bool) *InputElement

FormNoValidate sets the formNoValidate attribute.

func (*InputElement) FormTarget

func (e *InputElement) FormTarget(v string) *InputElement

FormTarget sets the formTarget attribute.

func (*InputElement) Indeterminate

func (e *InputElement) Indeterminate(v bool) *InputElement

Indeterminate sets the indeterminate attribute.

func (*InputElement) Max

func (e *InputElement) Max(v string) *InputElement

Max sets the max attribute.

func (*InputElement) MaxLength

func (e *InputElement) MaxLength(v int) *InputElement

MaxLength sets the maxLength attribute.

func (*InputElement) Min

func (e *InputElement) Min(v string) *InputElement

Min sets the min attribute.

func (*InputElement) MinLength

func (e *InputElement) MinLength(v int) *InputElement

MinLength sets the minLength attribute.

func (*InputElement) Multiple

func (e *InputElement) Multiple(v bool) *InputElement

Multiple sets the multiple attribute.

func (*InputElement) Name

func (e *InputElement) Name(v string) *InputElement

Name sets the name attribute.

func (*InputElement) Pattern

func (e *InputElement) Pattern(v string) *InputElement

Pattern sets the pattern attribute.

func (*InputElement) Placeholder

func (e *InputElement) Placeholder(v string) *InputElement

Placeholder sets the placeholder attribute.

func (*InputElement) PopoverTargetAction

func (e *InputElement) PopoverTargetAction(v string) *InputElement

PopoverTargetAction sets the popoverTargetAction attribute.

func (*InputElement) ReadOnly

func (e *InputElement) ReadOnly(v bool) *InputElement

ReadOnly sets the readOnly attribute.

func (*InputElement) Render

func (e *InputElement) Render() string

Render returns the HTML string representation.

func (*InputElement) Required

func (e *InputElement) Required(v bool) *InputElement

Required sets the required attribute.

func (*InputElement) Src

func (e *InputElement) Src(v string) *InputElement

Src sets the src attribute.

func (*InputElement) Step

func (e *InputElement) Step(v string) *InputElement

Step sets the step attribute.

func (*InputElement) Type

func (e *InputElement) Type(v string) *InputElement

Type sets the type attribute.

func (*InputElement) UseMap

func (e *InputElement) UseMap(v string) *InputElement

UseMap sets the useMap attribute.

func (*InputElement) ValidationMessage

func (e *InputElement) ValidationMessage(v string) *InputElement

ValidationMessage sets the validationMessage attribute.

func (*InputElement) Validity

func (e *InputElement) Validity(v string) *InputElement

Validity sets the validity attribute.

func (*InputElement) WillValidate

func (e *InputElement) WillValidate(v bool) *InputElement

WillValidate sets the willValidate attribute.

type LIElement

type LIElement[C HTMLContent] basicElement[C]

func Li

func Li(children ...HTMLContent) *LIElement[HTMLContent]

Li creates a new <li> element.

func (*LIElement[C]) Attr

func (e *LIElement[C]) Attr(key, value string) *LIElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*LIElement[C]) Render

func (e *LIElement[C]) Render() string

Render returns the HTML string representation.

func (*LIElement[C]) Type

func (e *LIElement[C]) Type(v string) *LIElement[C]

Type sets the type attribute.

func (*LIElement[C]) Value

func (e *LIElement[C]) Value(v int) *LIElement[C]

Value sets the value attribute.

type LabelElement

type LabelElement[C HTMLContent] basicElement[C]

func Label

func Label(children ...HTMLContent) *LabelElement[HTMLContent]

Label creates a new <label> element.

func (*LabelElement[C]) Attr

func (e *LabelElement[C]) Attr(key, value string) *LabelElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*LabelElement[C]) HtmlFor

func (e *LabelElement[C]) HtmlFor(v string) *LabelElement[C]

HtmlFor sets the htmlFor attribute.

func (*LabelElement[C]) Render

func (e *LabelElement[C]) Render() string

Render returns the HTML string representation.

type LegendElement

type LegendElement[C HTMLContent] basicElement[C]

func Legend

func Legend(children ...HTMLContent) *LegendElement[HTMLContent]

Legend creates a new <legend> element.

func (*LegendElement[C]) Align

func (e *LegendElement[C]) Align(v string) *LegendElement[C]

Align sets the align attribute.

func (*LegendElement[C]) Attr

func (e *LegendElement[C]) Attr(key, value string) *LegendElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*LegendElement[C]) Render

func (e *LegendElement[C]) Render() string

Render returns the HTML string representation.

type LinkElement

type LinkElement basicElement[HTMLContent]
func Link() *LinkElement

Link creates a new <link> element.

func (*LinkElement) As

func (e *LinkElement) As(v string) *LinkElement

As sets the as attribute.

func (*LinkElement) Attr

func (e *LinkElement) Attr(key, value string) *LinkElement

Attr sets an arbitrary attribute as an escape hatch.

func (*LinkElement) Blocking

func (e *LinkElement) Blocking(v string) *LinkElement

Blocking sets the blocking attribute.

func (*LinkElement) Charset

func (e *LinkElement) Charset(v string) *LinkElement

Charset sets the charset attribute.

func (*LinkElement) Disabled

func (e *LinkElement) Disabled(v bool) *LinkElement

Disabled sets the disabled attribute.

func (*LinkElement) FetchPriority

func (e *LinkElement) FetchPriority(v string) *LinkElement

FetchPriority sets the fetchPriority attribute.

func (*LinkElement) Href

func (e *LinkElement) Href(v string) *LinkElement

Href sets the href attribute.

func (*LinkElement) Hreflang

func (e *LinkElement) Hreflang(v string) *LinkElement

Hreflang sets the hreflang attribute.

func (*LinkElement) ImageSizes

func (e *LinkElement) ImageSizes(v string) *LinkElement

ImageSizes sets the imageSizes attribute.

func (*LinkElement) ImageSrcset

func (e *LinkElement) ImageSrcset(v string) *LinkElement

ImageSrcset sets the imageSrcset attribute.

func (*LinkElement) Integrity

func (e *LinkElement) Integrity(v string) *LinkElement

Integrity sets the integrity attribute.

func (*LinkElement) Media

func (e *LinkElement) Media(v string) *LinkElement

Media sets the media attribute.

func (*LinkElement) ReferrerPolicy

func (e *LinkElement) ReferrerPolicy(v string) *LinkElement

ReferrerPolicy sets the referrerPolicy attribute.

func (*LinkElement) Rel

func (e *LinkElement) Rel(v string) *LinkElement

Rel sets the rel attribute.

func (*LinkElement) RelList

func (e *LinkElement) RelList(v string) *LinkElement

RelList sets the relList attribute.

func (*LinkElement) Render

func (e *LinkElement) Render() string

Render returns the HTML string representation.

func (*LinkElement) Rev

func (e *LinkElement) Rev(v string) *LinkElement

Rev sets the rev attribute.

func (*LinkElement) Sizes

func (e *LinkElement) Sizes(v string) *LinkElement

Sizes sets the sizes attribute.

func (*LinkElement) Target

func (e *LinkElement) Target(v string) *LinkElement

Target sets the target attribute.

func (*LinkElement) Type

func (e *LinkElement) Type(v string) *LinkElement

Type sets the type attribute.

type MapElement

type MapElement[C HTMLContent] basicElement[C]

func Map

func Map(children ...HTMLContent) *MapElement[HTMLContent]

Map creates a new <map> element.

func (*MapElement[C]) Areas

func (e *MapElement[C]) Areas(v string) *MapElement[C]

Areas sets the areas attribute.

func (*MapElement[C]) Attr

func (e *MapElement[C]) Attr(key, value string) *MapElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*MapElement[C]) Name

func (e *MapElement[C]) Name(v string) *MapElement[C]

Name sets the name attribute.

func (*MapElement[C]) Render

func (e *MapElement[C]) Render() string

Render returns the HTML string representation.

type MarqueeElement

type MarqueeElement[C HTMLContent] basicElement[C]

func Marquee

func Marquee(children ...HTMLContent) *MarqueeElement[HTMLContent]

Marquee creates a new <marquee> element.

func (*MarqueeElement[C]) Attr

func (e *MarqueeElement[C]) Attr(key, value string) *MarqueeElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*MarqueeElement[C]) Behavior

func (e *MarqueeElement[C]) Behavior(v string) *MarqueeElement[C]

Behavior sets the behavior attribute.

func (*MarqueeElement[C]) BgColor

func (e *MarqueeElement[C]) BgColor(v string) *MarqueeElement[C]

BgColor sets the bgColor attribute.

func (*MarqueeElement[C]) Direction

func (e *MarqueeElement[C]) Direction(v string) *MarqueeElement[C]

Direction sets the direction attribute.

func (*MarqueeElement[C]) Height

func (e *MarqueeElement[C]) Height(v string) *MarqueeElement[C]

Height sets the height attribute.

func (*MarqueeElement[C]) Loop

func (e *MarqueeElement[C]) Loop(v int) *MarqueeElement[C]

Loop sets the loop attribute.

func (*MarqueeElement[C]) Render

func (e *MarqueeElement[C]) Render() string

Render returns the HTML string representation.

func (*MarqueeElement[C]) TrueSpeed

func (e *MarqueeElement[C]) TrueSpeed(v bool) *MarqueeElement[C]

TrueSpeed sets the trueSpeed attribute.

func (*MarqueeElement[C]) Width

func (e *MarqueeElement[C]) Width(v string) *MarqueeElement[C]

Width sets the width attribute.

type MediaElement

type MediaElement[C HTMLContent] basicElement[C]

func Media

func Media(children ...HTMLContent) *MediaElement[HTMLContent]

Media creates a new <media> element.

func (*MediaElement[C]) Attr

func (e *MediaElement[C]) Attr(key, value string) *MediaElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*MediaElement[C]) AudioTracks

func (e *MediaElement[C]) AudioTracks(v string) *MediaElement[C]

AudioTracks sets the audioTracks attribute.

func (*MediaElement[C]) Autoplay

func (e *MediaElement[C]) Autoplay(v bool) *MediaElement[C]

Autoplay sets the autoplay attribute.

func (*MediaElement[C]) Buffered

func (e *MediaElement[C]) Buffered(v string) *MediaElement[C]

Buffered sets the buffered attribute.

func (*MediaElement[C]) Controls

func (e *MediaElement[C]) Controls(v bool) *MediaElement[C]

Controls sets the controls attribute.

func (*MediaElement[C]) CurrentSrc

func (e *MediaElement[C]) CurrentSrc(v string) *MediaElement[C]

CurrentSrc sets the currentSrc attribute.

func (*MediaElement[C]) CurrentTime

func (e *MediaElement[C]) CurrentTime(v float64) *MediaElement[C]

CurrentTime sets the currentTime attribute.

func (*MediaElement[C]) DefaultMuted

func (e *MediaElement[C]) DefaultMuted(v bool) *MediaElement[C]

DefaultMuted sets the defaultMuted attribute.

func (*MediaElement[C]) DefaultPlaybackRate

func (e *MediaElement[C]) DefaultPlaybackRate(v float64) *MediaElement[C]

DefaultPlaybackRate sets the defaultPlaybackRate attribute.

func (*MediaElement[C]) Ended

func (e *MediaElement[C]) Ended(v bool) *MediaElement[C]

Ended sets the ended attribute.

func (*MediaElement[C]) Loop

func (e *MediaElement[C]) Loop(v bool) *MediaElement[C]

Loop sets the loop attribute.

func (*MediaElement[C]) Muted

func (e *MediaElement[C]) Muted(v bool) *MediaElement[C]

Muted sets the muted attribute.

func (*MediaElement[C]) Paused

func (e *MediaElement[C]) Paused(v bool) *MediaElement[C]

Paused sets the paused attribute.

func (*MediaElement[C]) PlaybackRate

func (e *MediaElement[C]) PlaybackRate(v float64) *MediaElement[C]

PlaybackRate sets the playbackRate attribute.

func (*MediaElement[C]) Played

func (e *MediaElement[C]) Played(v string) *MediaElement[C]

Played sets the played attribute.

func (*MediaElement[C]) Preload

func (e *MediaElement[C]) Preload(v string) *MediaElement[C]

Preload sets the preload attribute.

func (*MediaElement[C]) PreservesPitch

func (e *MediaElement[C]) PreservesPitch(v bool) *MediaElement[C]

PreservesPitch sets the preservesPitch attribute.

func (*MediaElement[C]) Render

func (e *MediaElement[C]) Render() string

Render returns the HTML string representation.

func (*MediaElement[C]) Seekable

func (e *MediaElement[C]) Seekable(v string) *MediaElement[C]

Seekable sets the seekable attribute.

func (*MediaElement[C]) Seeking

func (e *MediaElement[C]) Seeking(v bool) *MediaElement[C]

Seeking sets the seeking attribute.

func (*MediaElement[C]) Src

func (e *MediaElement[C]) Src(v string) *MediaElement[C]

Src sets the src attribute.

func (*MediaElement[C]) TextTracks

func (e *MediaElement[C]) TextTracks(v string) *MediaElement[C]

TextTracks sets the textTracks attribute.

func (*MediaElement[C]) VideoTracks

func (e *MediaElement[C]) VideoTracks(v string) *MediaElement[C]

VideoTracks sets the videoTracks attribute.

func (*MediaElement[C]) Volume

func (e *MediaElement[C]) Volume(v float64) *MediaElement[C]

Volume sets the volume attribute.

type MenuElement[C HTMLContent] basicElement[C]
func Menu(children ...HTMLContent) *MenuElement[HTMLContent]

Menu creates a new <menu> element.

func (e *MenuElement[C]) Attr(key, value string) *MenuElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (e *MenuElement[C]) Compact(v bool) *MenuElement[C]

Compact sets the compact attribute.

func (e *MenuElement[C]) Render() string

Render returns the HTML string representation.

type MetaElement

type MetaElement basicElement[HTMLContent]

func Meta

func Meta() *MetaElement

Meta creates a new <meta> element.

func (*MetaElement) Attr

func (e *MetaElement) Attr(key, value string) *MetaElement

Attr sets an arbitrary attribute as an escape hatch.

func (*MetaElement) Content

func (e *MetaElement) Content(v string) *MetaElement

Content sets the content attribute.

func (*MetaElement) HttpEquiv

func (e *MetaElement) HttpEquiv(v string) *MetaElement

HttpEquiv sets the httpEquiv attribute.

func (*MetaElement) Media

func (e *MetaElement) Media(v string) *MetaElement

Media sets the media attribute.

func (*MetaElement) Name

func (e *MetaElement) Name(v string) *MetaElement

Name sets the name attribute.

func (*MetaElement) Render

func (e *MetaElement) Render() string

Render returns the HTML string representation.

func (*MetaElement) Scheme

func (e *MetaElement) Scheme(v string) *MetaElement

Scheme sets the scheme attribute.

type MeterElement

type MeterElement[C HTMLContent] basicElement[C]

func Meter

func Meter(children ...HTMLContent) *MeterElement[HTMLContent]

Meter creates a new <meter> element.

func (*MeterElement[C]) Attr

func (e *MeterElement[C]) Attr(key, value string) *MeterElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*MeterElement[C]) High

func (e *MeterElement[C]) High(v float64) *MeterElement[C]

High sets the high attribute.

func (*MeterElement[C]) Labels

func (e *MeterElement[C]) Labels(v string) *MeterElement[C]

Labels sets the labels attribute.

func (*MeterElement[C]) Low

func (e *MeterElement[C]) Low(v float64) *MeterElement[C]

Low sets the low attribute.

func (*MeterElement[C]) Max

func (e *MeterElement[C]) Max(v float64) *MeterElement[C]

Max sets the max attribute.

func (*MeterElement[C]) Min

func (e *MeterElement[C]) Min(v float64) *MeterElement[C]

Min sets the min attribute.

func (*MeterElement[C]) Optimum

func (e *MeterElement[C]) Optimum(v float64) *MeterElement[C]

Optimum sets the optimum attribute.

func (*MeterElement[C]) Render

func (e *MeterElement[C]) Render() string

Render returns the HTML string representation.

func (*MeterElement[C]) Value

func (e *MeterElement[C]) Value(v float64) *MeterElement[C]

Value sets the value attribute.

type OListElement

type OListElement[C HTMLContent] basicElement[C]

func Ol

func Ol(children ...HTMLContent) *OListElement[HTMLContent]

Ol creates a new <ol> element.

func (*OListElement[C]) Attr

func (e *OListElement[C]) Attr(key, value string) *OListElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*OListElement[C]) Compact

func (e *OListElement[C]) Compact(v bool) *OListElement[C]

Compact sets the compact attribute.

func (*OListElement[C]) Render

func (e *OListElement[C]) Render() string

Render returns the HTML string representation.

func (*OListElement[C]) Reversed

func (e *OListElement[C]) Reversed(v bool) *OListElement[C]

Reversed sets the reversed attribute.

func (*OListElement[C]) Start

func (e *OListElement[C]) Start(v int) *OListElement[C]

Start sets the start attribute.

func (*OListElement[C]) Type

func (e *OListElement[C]) Type(v string) *OListElement[C]

Type sets the type attribute.

type ObjectElement

type ObjectElement[C HTMLContent] basicElement[C]

func Object

func Object(children ...HTMLContent) *ObjectElement[HTMLContent]

Object creates a new <object> element.

func (*ObjectElement[C]) Align

func (e *ObjectElement[C]) Align(v string) *ObjectElement[C]

Align sets the align attribute.

func (*ObjectElement[C]) Archive

func (e *ObjectElement[C]) Archive(v string) *ObjectElement[C]

Archive sets the archive attribute.

func (*ObjectElement[C]) Attr

func (e *ObjectElement[C]) Attr(key, value string) *ObjectElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*ObjectElement[C]) Code

func (e *ObjectElement[C]) Code(v string) *ObjectElement[C]

Code sets the code attribute.

func (*ObjectElement[C]) CodeBase

func (e *ObjectElement[C]) CodeBase(v string) *ObjectElement[C]

CodeBase sets the codeBase attribute.

func (*ObjectElement[C]) CodeType

func (e *ObjectElement[C]) CodeType(v string) *ObjectElement[C]

CodeType sets the codeType attribute.

func (*ObjectElement[C]) Data

func (e *ObjectElement[C]) Data(v string) *ObjectElement[C]

Data sets the data attribute.

func (*ObjectElement[C]) Declare

func (e *ObjectElement[C]) Declare(v bool) *ObjectElement[C]

Declare sets the declare attribute.

func (*ObjectElement[C]) Height

func (e *ObjectElement[C]) Height(v string) *ObjectElement[C]

Height sets the height attribute.

func (*ObjectElement[C]) Name

func (e *ObjectElement[C]) Name(v string) *ObjectElement[C]

Name sets the name attribute.

func (*ObjectElement[C]) Render

func (e *ObjectElement[C]) Render() string

Render returns the HTML string representation.

func (*ObjectElement[C]) Standby

func (e *ObjectElement[C]) Standby(v string) *ObjectElement[C]

Standby sets the standby attribute.

func (*ObjectElement[C]) Type

func (e *ObjectElement[C]) Type(v string) *ObjectElement[C]

Type sets the type attribute.

func (*ObjectElement[C]) UseMap

func (e *ObjectElement[C]) UseMap(v string) *ObjectElement[C]

UseMap sets the useMap attribute.

func (*ObjectElement[C]) ValidationMessage

func (e *ObjectElement[C]) ValidationMessage(v string) *ObjectElement[C]

ValidationMessage sets the validationMessage attribute.

func (*ObjectElement[C]) Validity

func (e *ObjectElement[C]) Validity(v string) *ObjectElement[C]

Validity sets the validity attribute.

func (*ObjectElement[C]) Width

func (e *ObjectElement[C]) Width(v string) *ObjectElement[C]

Width sets the width attribute.

func (*ObjectElement[C]) WillValidate

func (e *ObjectElement[C]) WillValidate(v bool) *ObjectElement[C]

WillValidate sets the willValidate attribute.

type OptGroupElement

type OptGroupElement[C HTMLContent] basicElement[C]

func Optgroup

func Optgroup(children ...HTMLContent) *OptGroupElement[HTMLContent]

Optgroup creates a new <optgroup> element.

func (*OptGroupElement[C]) Attr

func (e *OptGroupElement[C]) Attr(key, value string) *OptGroupElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*OptGroupElement[C]) Disabled

func (e *OptGroupElement[C]) Disabled(v bool) *OptGroupElement[C]

Disabled sets the disabled attribute.

func (*OptGroupElement[C]) Label

func (e *OptGroupElement[C]) Label(v string) *OptGroupElement[C]

Label sets the label attribute.

func (*OptGroupElement[C]) Render

func (e *OptGroupElement[C]) Render() string

Render returns the HTML string representation.

type OptionElement

type OptionElement[C HTMLContent] basicElement[C]

func Option

func Option(children ...HTMLContent) *OptionElement[HTMLContent]

Option creates a new <option> element.

func (*OptionElement[C]) Attr

func (e *OptionElement[C]) Attr(key, value string) *OptionElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*OptionElement[C]) DefaultSelected

func (e *OptionElement[C]) DefaultSelected(v bool) *OptionElement[C]

DefaultSelected sets the defaultSelected attribute.

func (*OptionElement[C]) Disabled

func (e *OptionElement[C]) Disabled(v bool) *OptionElement[C]

Disabled sets the disabled attribute.

func (*OptionElement[C]) Index

func (e *OptionElement[C]) Index(v int) *OptionElement[C]

Index sets the index attribute.

func (*OptionElement[C]) Label

func (e *OptionElement[C]) Label(v string) *OptionElement[C]

Label sets the label attribute.

func (*OptionElement[C]) Render

func (e *OptionElement[C]) Render() string

Render returns the HTML string representation.

func (*OptionElement[C]) Selected

func (e *OptionElement[C]) Selected(v bool) *OptionElement[C]

Selected sets the selected attribute.

func (*OptionElement[C]) Text

func (e *OptionElement[C]) Text(v string) *OptionElement[C]

Text sets the text attribute.

func (*OptionElement[C]) Value

func (e *OptionElement[C]) Value(v string) *OptionElement[C]

Value sets the value attribute.

type OutputElement

type OutputElement[C HTMLContent] basicElement[C]

func Output

func Output(children ...HTMLContent) *OutputElement[HTMLContent]

Output creates a new <output> element.

func (*OutputElement[C]) Attr

func (e *OutputElement[C]) Attr(key, value string) *OutputElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*OutputElement[C]) DefaultValue

func (e *OutputElement[C]) DefaultValue(v string) *OutputElement[C]

DefaultValue sets the defaultValue attribute.

func (*OutputElement[C]) HtmlFor

func (e *OutputElement[C]) HtmlFor(v string) *OutputElement[C]

HtmlFor sets the htmlFor attribute.

func (*OutputElement[C]) Labels

func (e *OutputElement[C]) Labels(v string) *OutputElement[C]

Labels sets the labels attribute.

func (*OutputElement[C]) Name

func (e *OutputElement[C]) Name(v string) *OutputElement[C]

Name sets the name attribute.

func (*OutputElement[C]) Render

func (e *OutputElement[C]) Render() string

Render returns the HTML string representation.

func (*OutputElement[C]) Type

func (e *OutputElement[C]) Type(v string) *OutputElement[C]

Type sets the type attribute.

func (*OutputElement[C]) ValidationMessage

func (e *OutputElement[C]) ValidationMessage(v string) *OutputElement[C]

ValidationMessage sets the validationMessage attribute.

func (*OutputElement[C]) Validity

func (e *OutputElement[C]) Validity(v string) *OutputElement[C]

Validity sets the validity attribute.

func (*OutputElement[C]) Value

func (e *OutputElement[C]) Value(v string) *OutputElement[C]

Value sets the value attribute.

func (*OutputElement[C]) WillValidate

func (e *OutputElement[C]) WillValidate(v bool) *OutputElement[C]

WillValidate sets the willValidate attribute.

type ParagraphElement

type ParagraphElement[C HTMLContent] basicElement[C]

func P

func P(children ...HTMLContent) *ParagraphElement[HTMLContent]

P creates a new <p> element.

func (*ParagraphElement[C]) Align

func (e *ParagraphElement[C]) Align(v string) *ParagraphElement[C]

Align sets the align attribute.

func (*ParagraphElement[C]) Attr

func (e *ParagraphElement[C]) Attr(key, value string) *ParagraphElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*ParagraphElement[C]) Render

func (e *ParagraphElement[C]) Render() string

Render returns the HTML string representation.

type ParamElement

type ParamElement basicElement[HTMLContent]

func Param

func Param() *ParamElement

Param creates a new <param> element.

func (*ParamElement) Attr

func (e *ParamElement) Attr(key, value string) *ParamElement

Attr sets an arbitrary attribute as an escape hatch.

func (*ParamElement) Name

func (e *ParamElement) Name(v string) *ParamElement

Name sets the name attribute.

func (*ParamElement) Render

func (e *ParamElement) Render() string

Render returns the HTML string representation.

func (*ParamElement) Type

func (e *ParamElement) Type(v string) *ParamElement

Type sets the type attribute.

func (*ParamElement) Value

func (e *ParamElement) Value(v string) *ParamElement

Value sets the value attribute.

func (*ParamElement) ValueType

func (e *ParamElement) ValueType(v string) *ParamElement

ValueType sets the valueType attribute.

type PictureElement

type PictureElement[C HTMLContent] basicElement[C]

func Picture

func Picture(children ...HTMLContent) *PictureElement[HTMLContent]

Picture creates a new <picture> element.

func (*PictureElement[C]) Attr

func (e *PictureElement[C]) Attr(key, value string) *PictureElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*PictureElement[C]) Render

func (e *PictureElement[C]) Render() string

Render returns the HTML string representation.

type PreElement

type PreElement[C HTMLContent] basicElement[C]

func Pre

func Pre(children ...HTMLContent) *PreElement[HTMLContent]

Pre creates a new <pre> element.

func (*PreElement[C]) Attr

func (e *PreElement[C]) Attr(key, value string) *PreElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*PreElement[C]) Render

func (e *PreElement[C]) Render() string

Render returns the HTML string representation.

func (*PreElement[C]) Width

func (e *PreElement[C]) Width(v int) *PreElement[C]

Width sets the width attribute.

type ProgressElement

type ProgressElement[C HTMLContent] basicElement[C]

func Progress

func Progress(children ...HTMLContent) *ProgressElement[HTMLContent]

Progress creates a new <progress> element.

func (*ProgressElement[C]) Attr

func (e *ProgressElement[C]) Attr(key, value string) *ProgressElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*ProgressElement[C]) Labels

func (e *ProgressElement[C]) Labels(v string) *ProgressElement[C]

Labels sets the labels attribute.

func (*ProgressElement[C]) Max

func (e *ProgressElement[C]) Max(v float64) *ProgressElement[C]

Max sets the max attribute.

func (*ProgressElement[C]) Position

func (e *ProgressElement[C]) Position(v float64) *ProgressElement[C]

Position sets the position attribute.

func (*ProgressElement[C]) Render

func (e *ProgressElement[C]) Render() string

Render returns the HTML string representation.

func (*ProgressElement[C]) Value

func (e *ProgressElement[C]) Value(v float64) *ProgressElement[C]

Value sets the value attribute.

type QuoteElement

type QuoteElement[C HTMLContent] basicElement[C]

func Q

func Q(children ...HTMLContent) *QuoteElement[HTMLContent]

Q creates a new <q> element.

func (*QuoteElement[C]) Attr

func (e *QuoteElement[C]) Attr(key, value string) *QuoteElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*QuoteElement[C]) Cite

func (e *QuoteElement[C]) Cite(v string) *QuoteElement[C]

Cite sets the cite attribute.

func (*QuoteElement[C]) Render

func (e *QuoteElement[C]) Render() string

Render returns the HTML string representation.

type Raw

type Raw string

Raw represents trusted HTML that should not be escaped. Use this ONLY for known-safe content from trusted sources.

func (Raw) Render

func (r Raw) Render() string

Render returns the raw HTML without escaping.

type ScriptElement

type ScriptElement[C HTMLContent] basicElement[C]

func Script

func Script(children ...HTMLContent) *ScriptElement[HTMLContent]

Script creates a new <script> element.

func (*ScriptElement[C]) Async

func (e *ScriptElement[C]) Async(v bool) *ScriptElement[C]

Async sets the async attribute.

func (*ScriptElement[C]) Attr

func (e *ScriptElement[C]) Attr(key, value string) *ScriptElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*ScriptElement[C]) Blocking

func (e *ScriptElement[C]) Blocking(v string) *ScriptElement[C]

Blocking sets the blocking attribute.

func (*ScriptElement[C]) Charset

func (e *ScriptElement[C]) Charset(v string) *ScriptElement[C]

Charset sets the charset attribute.

func (*ScriptElement[C]) Defer

func (e *ScriptElement[C]) Defer(v bool) *ScriptElement[C]

Defer sets the defer attribute.

func (*ScriptElement[C]) Event

func (e *ScriptElement[C]) Event(v string) *ScriptElement[C]

Event sets the event attribute.

func (*ScriptElement[C]) FetchPriority

func (e *ScriptElement[C]) FetchPriority(v string) *ScriptElement[C]

FetchPriority sets the fetchPriority attribute.

func (*ScriptElement[C]) HtmlFor

func (e *ScriptElement[C]) HtmlFor(v string) *ScriptElement[C]

HtmlFor sets the htmlFor attribute.

func (*ScriptElement[C]) Integrity

func (e *ScriptElement[C]) Integrity(v string) *ScriptElement[C]

Integrity sets the integrity attribute.

func (*ScriptElement[C]) NoModule

func (e *ScriptElement[C]) NoModule(v bool) *ScriptElement[C]

NoModule sets the noModule attribute.

func (*ScriptElement[C]) ReferrerPolicy

func (e *ScriptElement[C]) ReferrerPolicy(v string) *ScriptElement[C]

ReferrerPolicy sets the referrerPolicy attribute.

func (*ScriptElement[C]) Render

func (e *ScriptElement[C]) Render() string

Render returns the HTML string representation.

func (*ScriptElement[C]) Src

func (e *ScriptElement[C]) Src(v string) *ScriptElement[C]

Src sets the src attribute.

func (*ScriptElement[C]) Text

func (e *ScriptElement[C]) Text(v string) *ScriptElement[C]

Text sets the text attribute.

func (*ScriptElement[C]) Type

func (e *ScriptElement[C]) Type(v string) *ScriptElement[C]

Type sets the type attribute.

type SelectElement

type SelectElement[C HTMLContent] basicElement[C]

func Select

func Select(children ...HTMLContent) *SelectElement[HTMLContent]

Select creates a new <select> element.

func (*SelectElement[C]) Attr

func (e *SelectElement[C]) Attr(key, value string) *SelectElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*SelectElement[C]) Autocomplete

func (e *SelectElement[C]) Autocomplete(v string) *SelectElement[C]

Autocomplete sets the autocomplete attribute.

func (*SelectElement[C]) Disabled

func (e *SelectElement[C]) Disabled(v bool) *SelectElement[C]

Disabled sets the disabled attribute.

func (*SelectElement[C]) Labels

func (e *SelectElement[C]) Labels(v string) *SelectElement[C]

Labels sets the labels attribute.

func (*SelectElement[C]) Multiple

func (e *SelectElement[C]) Multiple(v bool) *SelectElement[C]

Multiple sets the multiple attribute.

func (*SelectElement[C]) Name

func (e *SelectElement[C]) Name(v string) *SelectElement[C]

Name sets the name attribute.

func (*SelectElement[C]) Options

func (e *SelectElement[C]) Options(v string) *SelectElement[C]

Options sets the options attribute.

func (*SelectElement[C]) Render

func (e *SelectElement[C]) Render() string

Render returns the HTML string representation.

func (*SelectElement[C]) Required

func (e *SelectElement[C]) Required(v bool) *SelectElement[C]

Required sets the required attribute.

func (*SelectElement[C]) SelectedIndex

func (e *SelectElement[C]) SelectedIndex(v int) *SelectElement[C]

SelectedIndex sets the selectedIndex attribute.

func (*SelectElement[C]) SelectedOptions

func (e *SelectElement[C]) SelectedOptions(v string) *SelectElement[C]

SelectedOptions sets the selectedOptions attribute.

func (*SelectElement[C]) Type

func (e *SelectElement[C]) Type(v string) *SelectElement[C]

Type sets the type attribute.

func (*SelectElement[C]) ValidationMessage

func (e *SelectElement[C]) ValidationMessage(v string) *SelectElement[C]

ValidationMessage sets the validationMessage attribute.

func (*SelectElement[C]) Validity

func (e *SelectElement[C]) Validity(v string) *SelectElement[C]

Validity sets the validity attribute.

func (*SelectElement[C]) Value

func (e *SelectElement[C]) Value(v string) *SelectElement[C]

Value sets the value attribute.

func (*SelectElement[C]) WillValidate

func (e *SelectElement[C]) WillValidate(v bool) *SelectElement[C]

WillValidate sets the willValidate attribute.

type SelectedContentElement

type SelectedContentElement[C HTMLContent] basicElement[C]

func Selectedcontent

func Selectedcontent(children ...HTMLContent) *SelectedContentElement[HTMLContent]

Selectedcontent creates a new <selectedcontent> element.

func (*SelectedContentElement[C]) Attr

func (e *SelectedContentElement[C]) Attr(key, value string) *SelectedContentElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*SelectedContentElement[C]) Render

func (e *SelectedContentElement[C]) Render() string

Render returns the HTML string representation.

type SlotElement

type SlotElement[C HTMLContent] basicElement[C]

func Slot

func Slot(children ...HTMLContent) *SlotElement[HTMLContent]

Slot creates a new <slot> element.

func (*SlotElement[C]) Attr

func (e *SlotElement[C]) Attr(key, value string) *SlotElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*SlotElement[C]) Name

func (e *SlotElement[C]) Name(v string) *SlotElement[C]

Name sets the name attribute.

func (*SlotElement[C]) Render

func (e *SlotElement[C]) Render() string

Render returns the HTML string representation.

type SourceElement

type SourceElement basicElement[HTMLContent]

func Source

func Source() *SourceElement

Source creates a new <source> element.

func (*SourceElement) Attr

func (e *SourceElement) Attr(key, value string) *SourceElement

Attr sets an arbitrary attribute as an escape hatch.

func (*SourceElement) Media

func (e *SourceElement) Media(v string) *SourceElement

Media sets the media attribute.

func (*SourceElement) Render

func (e *SourceElement) Render() string

Render returns the HTML string representation.

func (*SourceElement) Sizes

func (e *SourceElement) Sizes(v string) *SourceElement

Sizes sets the sizes attribute.

func (*SourceElement) Src

func (e *SourceElement) Src(v string) *SourceElement

Src sets the src attribute.

func (*SourceElement) Srcset

func (e *SourceElement) Srcset(v string) *SourceElement

Srcset sets the srcset attribute.

func (*SourceElement) Type

func (e *SourceElement) Type(v string) *SourceElement

Type sets the type attribute.

type SpanElement

type SpanElement[C HTMLContent] basicElement[C]

func Span

func Span(children ...HTMLContent) *SpanElement[HTMLContent]

Span creates a new <span> element.

func (*SpanElement[C]) Attr

func (e *SpanElement[C]) Attr(key, value string) *SpanElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*SpanElement[C]) Render

func (e *SpanElement[C]) Render() string

Render returns the HTML string representation.

type StyleElement

type StyleElement[C HTMLContent] basicElement[C]

func Style

func Style(children ...HTMLContent) *StyleElement[HTMLContent]

Style creates a new <style> element.

func (*StyleElement[C]) Attr

func (e *StyleElement[C]) Attr(key, value string) *StyleElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*StyleElement[C]) Blocking

func (e *StyleElement[C]) Blocking(v string) *StyleElement[C]

Blocking sets the blocking attribute.

func (*StyleElement[C]) Disabled

func (e *StyleElement[C]) Disabled(v bool) *StyleElement[C]

Disabled sets the disabled attribute.

func (*StyleElement[C]) Media

func (e *StyleElement[C]) Media(v string) *StyleElement[C]

Media sets the media attribute.

func (*StyleElement[C]) Render

func (e *StyleElement[C]) Render() string

Render returns the HTML string representation.

func (*StyleElement[C]) Type

func (e *StyleElement[C]) Type(v string) *StyleElement[C]

Type sets the type attribute.

type TableCaptionElement

type TableCaptionElement[C HTMLContent] basicElement[C]

func Caption

func Caption(children ...HTMLContent) *TableCaptionElement[HTMLContent]

Caption creates a new <caption> element.

func (*TableCaptionElement[C]) Align

func (e *TableCaptionElement[C]) Align(v string) *TableCaptionElement[C]

Align sets the align attribute.

func (*TableCaptionElement[C]) Attr

func (e *TableCaptionElement[C]) Attr(key, value string) *TableCaptionElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TableCaptionElement[C]) Render

func (e *TableCaptionElement[C]) Render() string

Render returns the HTML string representation.

type TableCellElement

type TableCellElement[C HTMLContent] basicElement[C]

func Td

func Td(children ...HTMLContent) *TableCellElement[HTMLContent]

Td creates a new <td> element.

func (*TableCellElement[C]) Abbr

func (e *TableCellElement[C]) Abbr(v string) *TableCellElement[C]

Abbr sets the abbr attribute.

func (*TableCellElement[C]) Align

func (e *TableCellElement[C]) Align(v string) *TableCellElement[C]

Align sets the align attribute.

func (*TableCellElement[C]) Attr

func (e *TableCellElement[C]) Attr(key, value string) *TableCellElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TableCellElement[C]) Axis

func (e *TableCellElement[C]) Axis(v string) *TableCellElement[C]

Axis sets the axis attribute.

func (*TableCellElement[C]) CellIndex

func (e *TableCellElement[C]) CellIndex(v int) *TableCellElement[C]

CellIndex sets the cellIndex attribute.

func (*TableCellElement[C]) Ch

func (e *TableCellElement[C]) Ch(v string) *TableCellElement[C]

Ch sets the ch attribute.

func (*TableCellElement[C]) ChOff

func (e *TableCellElement[C]) ChOff(v string) *TableCellElement[C]

ChOff sets the chOff attribute.

func (*TableCellElement[C]) Headers

func (e *TableCellElement[C]) Headers(v string) *TableCellElement[C]

Headers sets the headers attribute.

func (*TableCellElement[C]) Height

func (e *TableCellElement[C]) Height(v string) *TableCellElement[C]

Height sets the height attribute.

func (*TableCellElement[C]) NoWrap

func (e *TableCellElement[C]) NoWrap(v bool) *TableCellElement[C]

NoWrap sets the noWrap attribute.

func (*TableCellElement[C]) Render

func (e *TableCellElement[C]) Render() string

Render returns the HTML string representation.

func (*TableCellElement[C]) Scope

func (e *TableCellElement[C]) Scope(v string) *TableCellElement[C]

Scope sets the scope attribute.

func (*TableCellElement[C]) VAlign

func (e *TableCellElement[C]) VAlign(v string) *TableCellElement[C]

VAlign sets the vAlign attribute.

func (*TableCellElement[C]) Width

func (e *TableCellElement[C]) Width(v string) *TableCellElement[C]

Width sets the width attribute.

type TableColElement

type TableColElement basicElement[HTMLContent]

func Col

func Col() *TableColElement

Col creates a new <col> element.

func (*TableColElement) Align

func (e *TableColElement) Align(v string) *TableColElement

Align sets the align attribute.

func (*TableColElement) Attr

func (e *TableColElement) Attr(key, value string) *TableColElement

Attr sets an arbitrary attribute as an escape hatch.

func (*TableColElement) Ch

Ch sets the ch attribute.

func (*TableColElement) ChOff

func (e *TableColElement) ChOff(v string) *TableColElement

ChOff sets the chOff attribute.

func (*TableColElement) Render

func (e *TableColElement) Render() string

Render returns the HTML string representation.

func (*TableColElement) VAlign

func (e *TableColElement) VAlign(v string) *TableColElement

VAlign sets the vAlign attribute.

func (*TableColElement) Width

func (e *TableColElement) Width(v string) *TableColElement

Width sets the width attribute.

type TableElement

type TableElement[C HTMLContent] basicElement[C]

func Table

func Table(children ...HTMLContent) *TableElement[HTMLContent]

Table creates a new <table> element.

func (*TableElement[C]) Align

func (e *TableElement[C]) Align(v string) *TableElement[C]

Align sets the align attribute.

func (*TableElement[C]) Attr

func (e *TableElement[C]) Attr(key, value string) *TableElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TableElement[C]) Border

func (e *TableElement[C]) Border(v string) *TableElement[C]

Border sets the border attribute.

func (*TableElement[C]) Frame

func (e *TableElement[C]) Frame(v string) *TableElement[C]

Frame sets the frame attribute.

func (*TableElement[C]) Render

func (e *TableElement[C]) Render() string

Render returns the HTML string representation.

func (*TableElement[C]) Rows

func (e *TableElement[C]) Rows(v string) *TableElement[C]

Rows sets the rows attribute.

func (*TableElement[C]) Rules

func (e *TableElement[C]) Rules(v string) *TableElement[C]

Rules sets the rules attribute.

func (*TableElement[C]) Summary

func (e *TableElement[C]) Summary(v string) *TableElement[C]

Summary sets the summary attribute.

func (*TableElement[C]) TBodies

func (e *TableElement[C]) TBodies(v string) *TableElement[C]

TBodies sets the tBodies attribute.

func (*TableElement[C]) Width

func (e *TableElement[C]) Width(v string) *TableElement[C]

Width sets the width attribute.

type TableRowElement

type TableRowElement[C HTMLContent] basicElement[C]

func Tr

func Tr(children ...HTMLContent) *TableRowElement[HTMLContent]

Tr creates a new <tr> element.

func (*TableRowElement[C]) Align

func (e *TableRowElement[C]) Align(v string) *TableRowElement[C]

Align sets the align attribute.

func (*TableRowElement[C]) Attr

func (e *TableRowElement[C]) Attr(key, value string) *TableRowElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TableRowElement[C]) Cells

func (e *TableRowElement[C]) Cells(v string) *TableRowElement[C]

Cells sets the cells attribute.

func (*TableRowElement[C]) Ch

func (e *TableRowElement[C]) Ch(v string) *TableRowElement[C]

Ch sets the ch attribute.

func (*TableRowElement[C]) ChOff

func (e *TableRowElement[C]) ChOff(v string) *TableRowElement[C]

ChOff sets the chOff attribute.

func (*TableRowElement[C]) Render

func (e *TableRowElement[C]) Render() string

Render returns the HTML string representation.

func (*TableRowElement[C]) RowIndex

func (e *TableRowElement[C]) RowIndex(v int) *TableRowElement[C]

RowIndex sets the rowIndex attribute.

func (*TableRowElement[C]) SectionRowIndex

func (e *TableRowElement[C]) SectionRowIndex(v int) *TableRowElement[C]

SectionRowIndex sets the sectionRowIndex attribute.

func (*TableRowElement[C]) VAlign

func (e *TableRowElement[C]) VAlign(v string) *TableRowElement[C]

VAlign sets the vAlign attribute.

type TemplateElement

type TemplateElement[C HTMLContent] basicElement[C]

func Template

func Template(children ...HTMLContent) *TemplateElement[HTMLContent]

Template creates a new <template> element.

func (*TemplateElement[C]) Attr

func (e *TemplateElement[C]) Attr(key, value string) *TemplateElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TemplateElement[C]) Content

func (e *TemplateElement[C]) Content(v string) *TemplateElement[C]

Content sets the content attribute.

func (*TemplateElement[C]) Render

func (e *TemplateElement[C]) Render() string

Render returns the HTML string representation.

func (*TemplateElement[C]) ShadowRootClonable

func (e *TemplateElement[C]) ShadowRootClonable(v bool) *TemplateElement[C]

ShadowRootClonable sets the shadowRootClonable attribute.

func (*TemplateElement[C]) ShadowRootCustomElementRegistry

func (e *TemplateElement[C]) ShadowRootCustomElementRegistry(v string) *TemplateElement[C]

ShadowRootCustomElementRegistry sets the shadowRootCustomElementRegistry attribute.

func (*TemplateElement[C]) ShadowRootDelegatesFocus

func (e *TemplateElement[C]) ShadowRootDelegatesFocus(v bool) *TemplateElement[C]

ShadowRootDelegatesFocus sets the shadowRootDelegatesFocus attribute.

func (*TemplateElement[C]) ShadowRootMode

func (e *TemplateElement[C]) ShadowRootMode(v string) *TemplateElement[C]

ShadowRootMode sets the shadowRootMode attribute.

func (*TemplateElement[C]) ShadowRootSerializable

func (e *TemplateElement[C]) ShadowRootSerializable(v bool) *TemplateElement[C]

ShadowRootSerializable sets the shadowRootSerializable attribute.

type Text

type Text struct {
	Value string
}

Text represents escaped text content.

func T

func T(s string) Text

T is a helper function that escapes text for safe rendering.

func (Text) Render

func (t Text) Render() string

Render automatically escapes the text content to prevent XSS.

type TextAreaElement

type TextAreaElement[C HTMLContent] basicElement[C]

func Textarea

func Textarea(children ...HTMLContent) *TextAreaElement[HTMLContent]

Textarea creates a new <textarea> element.

func (*TextAreaElement[C]) Attr

func (e *TextAreaElement[C]) Attr(key, value string) *TextAreaElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TextAreaElement[C]) Autocomplete

func (e *TextAreaElement[C]) Autocomplete(v string) *TextAreaElement[C]

Autocomplete sets the autocomplete attribute.

func (*TextAreaElement[C]) DefaultValue

func (e *TextAreaElement[C]) DefaultValue(v string) *TextAreaElement[C]

DefaultValue sets the defaultValue attribute.

func (*TextAreaElement[C]) DirName

func (e *TextAreaElement[C]) DirName(v string) *TextAreaElement[C]

DirName sets the dirName attribute.

func (*TextAreaElement[C]) Disabled

func (e *TextAreaElement[C]) Disabled(v bool) *TextAreaElement[C]

Disabled sets the disabled attribute.

func (*TextAreaElement[C]) Labels

func (e *TextAreaElement[C]) Labels(v string) *TextAreaElement[C]

Labels sets the labels attribute.

func (*TextAreaElement[C]) MaxLength

func (e *TextAreaElement[C]) MaxLength(v int) *TextAreaElement[C]

MaxLength sets the maxLength attribute.

func (*TextAreaElement[C]) MinLength

func (e *TextAreaElement[C]) MinLength(v int) *TextAreaElement[C]

MinLength sets the minLength attribute.

func (*TextAreaElement[C]) Name

func (e *TextAreaElement[C]) Name(v string) *TextAreaElement[C]

Name sets the name attribute.

func (*TextAreaElement[C]) Placeholder

func (e *TextAreaElement[C]) Placeholder(v string) *TextAreaElement[C]

Placeholder sets the placeholder attribute.

func (*TextAreaElement[C]) ReadOnly

func (e *TextAreaElement[C]) ReadOnly(v bool) *TextAreaElement[C]

ReadOnly sets the readOnly attribute.

func (*TextAreaElement[C]) Render

func (e *TextAreaElement[C]) Render() string

Render returns the HTML string representation.

func (*TextAreaElement[C]) Required

func (e *TextAreaElement[C]) Required(v bool) *TextAreaElement[C]

Required sets the required attribute.

func (*TextAreaElement[C]) SelectionDirection

func (e *TextAreaElement[C]) SelectionDirection(v string) *TextAreaElement[C]

SelectionDirection sets the selectionDirection attribute.

func (*TextAreaElement[C]) Type

func (e *TextAreaElement[C]) Type(v string) *TextAreaElement[C]

Type sets the type attribute.

func (*TextAreaElement[C]) ValidationMessage

func (e *TextAreaElement[C]) ValidationMessage(v string) *TextAreaElement[C]

ValidationMessage sets the validationMessage attribute.

func (*TextAreaElement[C]) Validity

func (e *TextAreaElement[C]) Validity(v string) *TextAreaElement[C]

Validity sets the validity attribute.

func (*TextAreaElement[C]) WillValidate

func (e *TextAreaElement[C]) WillValidate(v bool) *TextAreaElement[C]

WillValidate sets the willValidate attribute.

func (*TextAreaElement[C]) Wrap

func (e *TextAreaElement[C]) Wrap(v string) *TextAreaElement[C]

Wrap sets the wrap attribute.

type TimeElement

type TimeElement[C HTMLContent] basicElement[C]

func Time

func Time(children ...HTMLContent) *TimeElement[HTMLContent]

Time creates a new <time> element.

func (*TimeElement[C]) Attr

func (e *TimeElement[C]) Attr(key, value string) *TimeElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TimeElement[C]) DateTime

func (e *TimeElement[C]) DateTime(v string) *TimeElement[C]

DateTime sets the dateTime attribute.

func (*TimeElement[C]) Render

func (e *TimeElement[C]) Render() string

Render returns the HTML string representation.

type TitleElement

type TitleElement[C HTMLContent] basicElement[C]

func Title

func Title(children ...HTMLContent) *TitleElement[HTMLContent]

Title creates a new <title> element.

func (*TitleElement[C]) Attr

func (e *TitleElement[C]) Attr(key, value string) *TitleElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*TitleElement[C]) Render

func (e *TitleElement[C]) Render() string

Render returns the HTML string representation.

func (*TitleElement[C]) Text

func (e *TitleElement[C]) Text(v string) *TitleElement[C]

Text sets the text attribute.

type TrackElement

type TrackElement basicElement[HTMLContent]

func Track

func Track() *TrackElement

Track creates a new <track> element.

func (*TrackElement) Attr

func (e *TrackElement) Attr(key, value string) *TrackElement

Attr sets an arbitrary attribute as an escape hatch.

func (*TrackElement) Default

func (e *TrackElement) Default(v bool) *TrackElement

Default sets the default attribute.

func (*TrackElement) Kind

func (e *TrackElement) Kind(v string) *TrackElement

Kind sets the kind attribute.

func (*TrackElement) Label

func (e *TrackElement) Label(v string) *TrackElement

Label sets the label attribute.

func (*TrackElement) Render

func (e *TrackElement) Render() string

Render returns the HTML string representation.

func (*TrackElement) Src

func (e *TrackElement) Src(v string) *TrackElement

Src sets the src attribute.

func (*TrackElement) Srclang

func (e *TrackElement) Srclang(v string) *TrackElement

Srclang sets the srclang attribute.

func (*TrackElement) Track

func (e *TrackElement) Track(v string) *TrackElement

Track sets the track attribute.

type UListElement

type UListElement[C HTMLContent] basicElement[C]

func Ul

func Ul(children ...HTMLContent) *UListElement[HTMLContent]

Ul creates a new <ul> element.

func (*UListElement[C]) Attr

func (e *UListElement[C]) Attr(key, value string) *UListElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*UListElement[C]) Compact

func (e *UListElement[C]) Compact(v bool) *UListElement[C]

Compact sets the compact attribute.

func (*UListElement[C]) Render

func (e *UListElement[C]) Render() string

Render returns the HTML string representation.

func (*UListElement[C]) Type

func (e *UListElement[C]) Type(v string) *UListElement[C]

Type sets the type attribute.

type UnknownElement

type UnknownElement[C HTMLContent] basicElement[C]

func Unknown

func Unknown(children ...HTMLContent) *UnknownElement[HTMLContent]

Unknown creates a new <unknown> element.

func (*UnknownElement[C]) Attr

func (e *UnknownElement[C]) Attr(key, value string) *UnknownElement[C]

Attr sets an arbitrary attribute as an escape hatch.

func (*UnknownElement[C]) Render

func (e *UnknownElement[C]) Render() string

Render returns the HTML string representation.

Directories

Path Synopsis
cmd
generate command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL