html

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 3 Imported by: 8

README

Plain

Type‑safe HTML for Go. Server‑first, hypermedia by default, htmx as an optional extension. Compile‑time validation, zero hydration, no client runtime.

What is Plain?

Plain generates HTML using pure Go functions instead of template engines. Each element is a typed function with compile‑time validation and IDE autocomplete. You build pages from links and forms, keep state on the server, and add interactivity progressively (e.g., with htmx) — no SSR/hydration/SPA machinery.

Why

Template engines are runtime: Most Go HTML solutions parse templates at runtime, introduce string-based errors, and lack compile-time guarantees about HTML structure.

Struct-based builders are verbose: Existing HTML builders using structs require repetitive field assignments and don't provide intuitive composition patterns.

Missing type safety: HTML attributes and structure errors only surface at runtime or in browsers, not during development.

Plain solves these problems by providing compile-time HTML generation with function composition that feels natural in Go.

How it works

Function-based composition
div := Div(
    Class("container"),
    H1(T("Hello"), Class("title")),
    P(T("World"), Class("content")),
)
Type-safe attributes per element

Each HTML element has its own option types. Input elements only accept input-specific attributes:

// This compiles and works
input := Input(
    InputType("email"),
    InputName("email"),
    Required(),
    Placeholder("Enter email"),
)

// This fails at compile time - Href is not valid for Input
input := Input(Href("/invalid")) // Compile error
Zero runtime overhead

HTML generation happens through method dispatch resolved at compile time. No reflection, no runtime parsing:

component := Div(Class("test"), T("Hello"))
html := Render(component) // Pure string building

What you get

IDE support
  • Autocomplete: Functions and options show up in IDE completion
  • Go to definition: Jump directly to tag implementations
  • Refactoring: Rename functions across your entire codebase
  • Type checking: Invalid attribute combinations fail at compile time
Modular architecture

Each HTML element lives in its own file (tag_div.go, tag_input.go, etc.). This makes the codebase:

  • Easy to understand and contribute to
  • Simple to extend with new elements
  • Clear about what's supported
Testing integration

Components are just Go values. Test them like any other Go code:

func TestButton(t *testing.T) {
    btn := Button(
        ButtonType("submit"),
        T("Click me"),
        Class("btn"),
    )

    html := Render(btn)
    if !strings.Contains(html, `type="submit"`) {
        t.Error("Missing type attribute")
    }
}
Composition patterns

Build reusable components by composing smaller ones:

func Card(title, content string) Node {
    return Div(
        Class("card"),
        H2(T(title), Class("card-title")),
        P(T(content), Class("card-content")),
    )
}

func Page() Node {
    return Div(
        Class("container"),
        Card("Welcome", "Get started with Plain"),
        Card("Features", "Type-safe HTML in Go"),
    )
}

Installation

go get github.com/plainkit/html

Usage

Basic example
package main

import (
    "fmt"
    . "github.com/plainkit/html"
)

func main() {
    page := Html(
        Lang("en"),
        Head(
            HeadTitle(T("My Page")),
            Meta(Charset("UTF-8")),
			HeadStyle(T(".intro { color: blue; }")),
        ),
        Body(
            H1(T("Hello, World!")),
            P(T("Built with Plain"), Class("intro")),
        ),
    )

    fmt.Println("<!DOCTYPE html>")
    fmt.Println(Render(page))
}
Working with forms
loginForm := Form(
    Action("/login"),
    Method("POST"),
    Div(
        Label(For("email"), T("Email")),
        Input(
            InputType("email"),
            InputName("email"),
            Id("email"),
            Required(),
        ),
    ),
    Div(
        Label(For("password"), T("Password")),
        Input(
            InputType("password"),
            InputName("password"),
            Id("password"),
            Required(),
        ),
    ),
    Button(
        ButtonType("submit"),
        T("Login"),
    ),
)
HTTP handlers
func homeHandler(w http.ResponseWriter, r *http.Request) {
    page := Html(
        Lang("en"),
        Head(HeadTitle(T("Home"))),
        Body(
            H1(T("Welcome")),
            P(T("This page was built with Plain")),
        ),
    )

    w.Header().Set("Content-Type", "text/html")
    fmt.Fprint(w, "<!DOCTYPE html>\n")
    fmt.Fprint(w, Render(page))
}

Architecture

Core types
  • Component: Interface implemented by all HTML elements
  • Node: Struct representing an HTML element with tag, attributes, and children
  • TextNode: Represents plain text content
  • Global: Option type that works with any HTML element (class, id, etc.)
Tag-specific options

Each HTML element has dedicated option types:

  • InputType(), InputName(), Required() for Input()
  • Href(), Target(), Rel() for A()
  • ButtonType(), Disabled() for Button()
  • And so on for all HTML5 elements
File organization
├── core_node.go          # Component interface, Node struct, Render()
├── core_global.go        # GlobalAttrs struct, attribute helpers
├── core_options.go       # Global option constructors (Class, Id, etc.)
├── core_content.go       # Text() and Child() helpers
├── tag_div.go           # Div component and options
├── tag_input.go         # Input component and options
├── tag_form.go          # Form, Input, Textarea, Button, etc.
├── tag_semantic.go      # Header, Nav, Main, Section, etc.
└── ...                  # One file per logical group of elements

Contributing

The codebase is designed for easy contribution:

  1. Add a new HTML element: Create tag_newelem.go following existing patterns
  2. Add element-specific attributes: Define option types and apply* methods
  3. Test: Add examples to sample/ directory
  4. Document: Update this README with usage examples

Each tag file follows the same pattern:

  • Attrs struct with element-specific fields
  • Arg interface for type safety
  • Constructor function accepting variadic args
  • Option types and constructors
  • Apply methods connecting options to attributes
  • writeAttrs method for HTML generation

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(c Component) string

Types

type AArg

type AArg interface {
	// contains filtered or unexported methods
}

type AAttrs

type AAttrs struct {
	Global GlobalAttrs
	Href   string
	Target ATarget
	Rel    string
}

type ATarget

type ATarget string
const (
	TargetSelf  ATarget = "_self"
	TargetBlank ATarget = "_blank"
)

type AbbrArg

type AbbrArg interface {
	// contains filtered or unexported methods
}

type AbbrAttrs

type AbbrAttrs struct {
	Global GlobalAttrs
}

Abbr

type AcceptCharsetOpt

type AcceptCharsetOpt struct {
	// contains filtered or unexported fields
}

func AcceptCharset

func AcceptCharset(v string) AcceptCharsetOpt

type AcceptOpt

type AcceptOpt struct {
	// contains filtered or unexported fields
}

func Accept

func Accept(v string) AcceptOpt

type ActionOpt

type ActionOpt struct {
	// contains filtered or unexported fields
}

Form-specific options

func Action

func Action(v string) ActionOpt

type AddressArg

type AddressArg interface {
	// contains filtered or unexported methods
}

type AddressAttrs

type AddressAttrs struct {
	Global GlobalAttrs
}

Address

type AllowOpt

type AllowOpt struct {
	// contains filtered or unexported fields
}

func Allow

func Allow(v string) AllowOpt

type AllowfullscreenOpt

type AllowfullscreenOpt struct{}

func Allowfullscreen

func Allowfullscreen() AllowfullscreenOpt

type AltOpt

type AltOpt struct {
	// contains filtered or unexported fields
}

func Alt

func Alt(v string) AltOpt

type ArticleArg

type ArticleArg interface {
	// contains filtered or unexported methods
}

type ArticleAttrs

type ArticleAttrs struct {
	Global GlobalAttrs
}

Article

type AsideArg

type AsideArg interface {
	// contains filtered or unexported methods
}

type AsideAttrs

type AsideAttrs struct {
	Global GlobalAttrs
}

Aside

type Assets

type Assets struct {
	// contains filtered or unexported fields
}

Assets collects CSS and JS from components at compile-time

func NewAssets

func NewAssets() *Assets

NewAssets creates a new asset collector

func (*Assets) CSS

func (a *Assets) CSS() StyleComponent

CSS returns a style component with all collected CSS

func (*Assets) Collect

func (a *Assets) Collect(components ...Component)

Collect walks the component tree and gathers unique CSS/JS assets

func (*Assets) HasAssets

func (a *Assets) HasAssets() bool

HasAssets returns true if any CSS or JS was collected

func (*Assets) JS

func (a *Assets) JS() ScriptComponent

JS returns a script component with all collected JavaScript

func (*Assets) Reset

func (a *Assets) Reset()

Reset clears all collected assets

type AsyncOpt

type AsyncOpt struct{}

Script-specific options

func Async

func Async() AsyncOpt

type AudioArg

type AudioArg interface {
	// contains filtered or unexported methods
}

type AudioAttrs

type AudioAttrs struct {
	Global      GlobalAttrs
	Src         string
	Preload     string
	Autoplay    bool
	Loop        bool
	Muted       bool
	Controls    bool
	Crossorigin string
}

Audio

type AutocompleteOpt

type AutocompleteOpt struct {
	// contains filtered or unexported fields
}

func Autocomplete

func Autocomplete(v string) AutocompleteOpt

type AutoplayOpt

type AutoplayOpt struct{}

func Autoplay

func Autoplay() AutoplayOpt

type BArg

type BArg interface {
	// contains filtered or unexported methods
}

type BAttrs

type BAttrs struct {
	Global GlobalAttrs
}

B

type BaseProfileOpt

type BaseProfileOpt struct {
	// contains filtered or unexported fields
}

func BaseProfile

func BaseProfile(v string) BaseProfileOpt

type BlockquoteArg

type BlockquoteArg interface {
	// contains filtered or unexported methods
}

type BlockquoteAttrs

type BlockquoteAttrs struct {
	Global GlobalAttrs
	Cite   string
}

type BodyArg

type BodyArg interface {
	// contains filtered or unexported methods
}

type BodyAttrs

type BodyAttrs struct {
	Global GlobalAttrs
}

type BrArg

type BrArg interface {
	// contains filtered or unexported methods
}

type BrAttrs

type BrAttrs struct {
	Global GlobalAttrs
}

BR (void)

type ButtonArg

type ButtonArg interface {
	// contains filtered or unexported methods
}

type ButtonAttrs

type ButtonAttrs struct {
	Global         GlobalAttrs
	Type           string
	Name           string
	Value          string
	Disabled       bool
	Form           string
	Formaction     string
	Formenctype    string
	Formmethod     string
	Formnovalidate bool
	Formtarget     string
}

type ButtonNameOpt

type ButtonNameOpt struct {
	// contains filtered or unexported fields
}

func ButtonName

func ButtonName(v string) ButtonNameOpt

type ButtonTypeOpt

type ButtonTypeOpt struct {
	// contains filtered or unexported fields
}

Button-specific options

func ButtonType

func ButtonType(v string) ButtonTypeOpt

type ButtonValueOpt

type ButtonValueOpt struct {
	// contains filtered or unexported fields
}

func ButtonValue

func ButtonValue(v string) ButtonValueOpt

type CanvasArg

type CanvasArg interface {
	// contains filtered or unexported methods
}

type CanvasAttrs

type CanvasAttrs struct {
	Global GlobalAttrs
	Width  int
	Height int
}

Canvas

type CaptionArg

type CaptionArg interface {
	// contains filtered or unexported methods
}

type CaptionAttrs

type CaptionAttrs struct {
	Global GlobalAttrs
}

Caption

type CharsetOpt

type CharsetOpt struct {
	// contains filtered or unexported fields
}

func Charset

func Charset(v string) CharsetOpt

type CheckedOpt

type CheckedOpt struct{}

func Checked

func Checked() CheckedOpt

type ChildOpt

type ChildOpt struct {
	// contains filtered or unexported fields
}

func Child

func Child(c Component) ChildOpt

type CircleArg

type CircleArg interface {
	// contains filtered or unexported methods
}

type CircleAttrs

type CircleAttrs struct {
	Global           GlobalAttrs
	Cx               string
	Cy               string
	R                string
	PathLength       string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

Circle

type CitationArg

type CitationArg interface {
	// contains filtered or unexported methods
}

type CitationAttrs

type CitationAttrs struct {
	Global GlobalAttrs
}

CitationTag (avoiding conflict with Cite option)

type CiteOpt

type CiteOpt struct {
	// contains filtered or unexported fields
}

Tag-specific options

func Cite

func Cite(v string) CiteOpt

type CodeArg

type CodeArg interface {
	// contains filtered or unexported methods
}

type CodeAttrs

type CodeAttrs struct {
	Global GlobalAttrs
}

type ColArg

type ColArg interface {
	// contains filtered or unexported methods
}

type ColAttrs

type ColAttrs struct {
	Global GlobalAttrs
	Span   int
}

Col (void)

type ColgroupArg

type ColgroupArg interface {
	// contains filtered or unexported methods
}

type ColgroupAttrs

type ColgroupAttrs struct {
	Global GlobalAttrs
	Span   int
}

Colgroup

type ColsOpt

type ColsOpt struct {
	// contains filtered or unexported fields
}

func Cols

func Cols(v int) ColsOpt

type ColspanOpt

type ColspanOpt struct {
	// contains filtered or unexported fields
}

Td-specific options

func Colspan

func Colspan(v int) ColspanOpt

type Component

type Component interface {
	// contains filtered or unexported methods
}

func AssetHook

func AssetHook(name, css, js string) Component

AssetHook creates a component that carries CSS/JS for collection without rendering output. Name is used for de-duplication across the page.

type ContentOpt

type ContentOpt struct {
	// contains filtered or unexported fields
}

func Content

func Content(v string) ContentOpt

type ContentScriptTypeOpt

type ContentScriptTypeOpt struct {
	// contains filtered or unexported fields
}

func ContentScriptType

func ContentScriptType(v string) ContentScriptTypeOpt

type ContentStyleTypeOpt

type ContentStyleTypeOpt struct {
	// contains filtered or unexported fields
}

func ContentStyleType

func ContentStyleType(v string) ContentStyleTypeOpt

type ControlsOpt

type ControlsOpt struct{}

func Controls

func Controls() ControlsOpt

type CrossoriginOpt

type CrossoriginOpt struct {
	// contains filtered or unexported fields
}

func Crossorigin

func Crossorigin(v string) CrossoriginOpt

type CxOpt

type CxOpt struct {
	// contains filtered or unexported fields
}

Circle-specific options

func Cx

func Cx(v string) CxOpt

type CyOpt

type CyOpt struct {
	// contains filtered or unexported fields
}

func Cy

func Cy(v string) CyOpt

type DOpt

type DOpt struct {
	// contains filtered or unexported fields
}

Path-specific options

func D

func D(v string) DOpt

type DatalistArg

type DatalistArg interface {
	// contains filtered or unexported methods
}

type DatalistAttrs

type DatalistAttrs struct {
	Global GlobalAttrs
}

Datalist

type DatetimeOpt

type DatetimeOpt struct {
	// contains filtered or unexported fields
}

Datetime option used by <time>, <del>, and <ins>

func Datetime

func Datetime(v string) DatetimeOpt

type DdArg

type DdArg interface {
	// contains filtered or unexported methods
}

type DdAttrs

type DdAttrs struct {
	Global GlobalAttrs
}

DD (Description Definition)

type DecodingOpt

type DecodingOpt struct {
	// contains filtered or unexported fields
}

func Decoding

func Decoding(v string) DecodingOpt

type DefaultOpt

type DefaultOpt struct{}

func Default

func Default() DefaultOpt

type DeferOpt

type DeferOpt struct{}

func Defer

func Defer() DeferOpt

type DefsArg added in v0.8.0

type DefsArg interface {
	// contains filtered or unexported methods
}

type DefsAttrs added in v0.8.0

type DefsAttrs struct {
	Global           GlobalAttrs
	Transform        string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Opacity          string
}

Defs

type DelArg

type DelArg interface {
	// contains filtered or unexported methods
}

type DelAttrs

type DelAttrs struct {
	Global   GlobalAttrs
	Cite     string
	Datetime string
}

Del

type DetailsArg

type DetailsArg interface {
	// contains filtered or unexported methods
}

type DetailsAttrs

type DetailsAttrs struct {
	Global GlobalAttrs
	Open   bool
}

Details

type DfnArg

type DfnArg interface {
	// contains filtered or unexported methods
}

type DfnAttrs

type DfnAttrs struct {
	Global GlobalAttrs
}

Dfn

type DialogArg

type DialogArg interface {
	// contains filtered or unexported methods
}

type DialogAttrs

type DialogAttrs struct {
	Global GlobalAttrs
	Open   bool
}

Dialog

type DisabledOpt

type DisabledOpt struct{}

func Disabled

func Disabled() DisabledOpt

type DivArg

type DivArg interface {
	// contains filtered or unexported methods
}

type DivAttrs

type DivAttrs struct {
	Global GlobalAttrs
}

type DlArg

type DlArg interface {
	// contains filtered or unexported methods
}

type DlAttrs

type DlAttrs struct {
	Global GlobalAttrs
}

DL (Description List)

type DominantBaselineOpt

type DominantBaselineOpt struct {
	// contains filtered or unexported fields
}

func DominantBaseline

func DominantBaseline(v string) DominantBaselineOpt

type DtArg

type DtArg interface {
	// contains filtered or unexported methods
}

type DtAttrs

type DtAttrs struct {
	Global GlobalAttrs
}

DT (Description Term)

type DxOpt

type DxOpt struct {
	// contains filtered or unexported fields
}

func Dx

func Dx(v string) DxOpt

type DyOpt

type DyOpt struct {
	// contains filtered or unexported fields
}

func Dy

func Dy(v string) DyOpt

type EllipseArg

type EllipseArg interface {
	// contains filtered or unexported methods
}

type EllipseAttrs

type EllipseAttrs struct {
	Global           GlobalAttrs
	Cx               string
	Cy               string
	Rx               string
	Ry               string
	PathLength       string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

Ellipse

type EllipseCxOpt

type EllipseCxOpt struct {
	// contains filtered or unexported fields
}

Ellipse-specific options

func EllipseCx

func EllipseCx(v string) EllipseCxOpt

type EllipseCyOpt

type EllipseCyOpt struct {
	// contains filtered or unexported fields
}

func EllipseCy

func EllipseCy(v string) EllipseCyOpt

type EllipseRxOpt

type EllipseRxOpt struct {
	// contains filtered or unexported fields
}

func EllipseRx

func EllipseRx(v string) EllipseRxOpt

type EllipseRyOpt

type EllipseRyOpt struct {
	// contains filtered or unexported fields
}

func EllipseRy

func EllipseRy(v string) EllipseRyOpt

type EmArg

type EmArg interface {
	// contains filtered or unexported methods
}

type EmAttrs

type EmAttrs struct {
	Global GlobalAttrs
}

Em

type EnctypeOpt

type EnctypeOpt struct {
	// contains filtered or unexported fields
}

func Enctype

func Enctype(v string) EnctypeOpt

type FieldsetArg

type FieldsetArg interface {
	// contains filtered or unexported methods
}

type FieldsetAttrs

type FieldsetAttrs struct {
	Global   GlobalAttrs
	Disabled bool
	Form     string
	Name     string
}

Fieldset

type FigcaptionArg

type FigcaptionArg interface {
	// contains filtered or unexported methods
}

type FigcaptionAttrs

type FigcaptionAttrs struct {
	Global GlobalAttrs
}

Figcaption

type FigureArg

type FigureArg interface {
	// contains filtered or unexported methods
}

type FigureAttrs

type FigureAttrs struct {
	Global GlobalAttrs
}

Figure

type FillOpacityOpt

type FillOpacityOpt struct {
	// contains filtered or unexported fields
}

func FillOpacity

func FillOpacity(v string) FillOpacityOpt

type FillOpt

type FillOpt struct {
	// contains filtered or unexported fields
}

func Fill

func Fill(v string) FillOpt

type FillRuleOpt

type FillRuleOpt struct {
	// contains filtered or unexported fields
}

func FillRule

func FillRule(v string) FillRuleOpt

type FontFamilyOpt

type FontFamilyOpt struct {
	// contains filtered or unexported fields
}

func FontFamily

func FontFamily(v string) FontFamilyOpt

type FontSizeOpt

type FontSizeOpt struct {
	// contains filtered or unexported fields
}

func FontSize

func FontSize(v string) FontSizeOpt

type FontStyleOpt

type FontStyleOpt struct {
	// contains filtered or unexported fields
}

func FontStyle

func FontStyle(v string) FontStyleOpt

type FontWeightOpt

type FontWeightOpt struct {
	// contains filtered or unexported fields
}

func FontWeight

func FontWeight(v string) FontWeightOpt

type FooterArg

type FooterArg interface {
	// contains filtered or unexported methods
}

type FooterAttrs

type FooterAttrs struct {
	Global GlobalAttrs
}

Footer

type ForOpt

type ForOpt struct {
	// contains filtered or unexported fields
}

Label-specific options

func For

func For(v string) ForOpt

type FormArg

type FormArg interface {
	// contains filtered or unexported methods
}

type FormAttrs

type FormAttrs struct {
	Global        GlobalAttrs
	Action        string
	Method        string
	Enctype       string
	AcceptCharset string
	Autocomplete  string
	Novalidate    bool
	Target        string
}

type FormOpt

type FormOpt struct {
	// contains filtered or unexported fields
}

func FormAttr

func FormAttr(v string) FormOpt

type FormTargetOpt added in v0.10.0

type FormTargetOpt struct {
	// contains filtered or unexported fields
}

func FormTarget added in v0.10.0

func FormTarget(v string) FormTargetOpt

type FormactionOpt

type FormactionOpt struct {
	// contains filtered or unexported fields
}

func Formaction

func Formaction(v string) FormactionOpt

type FormenctypeOpt

type FormenctypeOpt struct {
	// contains filtered or unexported fields
}

func Formenctype

func Formenctype(v string) FormenctypeOpt

type FormmethodOpt

type FormmethodOpt struct {
	// contains filtered or unexported fields
}

func Formmethod

func Formmethod(v string) FormmethodOpt

type FormnovalidateOpt

type FormnovalidateOpt struct{}

func Formnovalidate

func Formnovalidate() FormnovalidateOpt

type FormtargetOpt

type FormtargetOpt struct {
	// contains filtered or unexported fields
}

func Formtarget

func Formtarget(v string) FormtargetOpt

type GArg

type GArg interface {
	// contains filtered or unexported methods
}

type GAttrs

type GAttrs struct {
	Global           GlobalAttrs
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

G (Group)

type Global

type Global struct {
	// contains filtered or unexported fields
}

Global option: one glue impl for all tags (methods are added in tag files)

func AccessKey

func AccessKey(v string) Global

func Aria

func Aria(k, v string) Global

func Autofocus

func Autofocus() Global

func Class

func Class(v string) Global

Global attribute constructors

func ContentEditable

func ContentEditable(v string) Global

func Custom

func Custom(k, v string) Global

func Data

func Data(k, v string) Global

Map-like convenience functions

func Dir

func Dir(v string) Global

func Draggable

func Draggable(b bool) Global

func EnterKeyHint

func EnterKeyHint(v string) Global

func ExportParts

func ExportParts(v string) Global

func Hidden

func Hidden() Global

func Id

func Id(v string) Global

func Inert

func Inert() Global

func InputMode

func InputMode(v string) Global

func IsAttr

func IsAttr(v string) Global

func ItemId

func ItemId(v string) Global

func ItemProp

func ItemProp(v string) Global

func ItemRef

func ItemRef(v string) Global

func ItemScope

func ItemScope(b bool) Global

func ItemType

func ItemType(v string) Global

func Lang

func Lang(v string) Global

func Nonce

func Nonce(v string) Global

func On

func On(ev, handler string) Global

func Part

func Part(v string) Global

func Popover

func Popover(v string) Global

func Role

func Role(v string) Global

func Slot

func Slot(v string) Global

func Spellcheck

func Spellcheck(b bool) Global

func Style

func Style(style string) Global

func TabIndex

func TabIndex(i int) Global

func Title

func Title(v string) Global

func Translate

func Translate(b bool) Global

func VirtualKeyboardPolicy

func VirtualKeyboardPolicy(v string) Global

func WritingSuggestions

func WritingSuggestions(b bool) Global

func XMLBase

func XMLBase(v string) Global

func XMLLang

func XMLLang(v string) Global

type GlobalAttrs

type GlobalAttrs struct {
	// Common core
	Id, Class, Title, Role, Lang, Dir, Slot, Part, Popover, Nonce, Is string
	AccessKey, ContentEditable, InputMode, EnterKeyHint, ExportParts  string
	ItemType, ItemId, ItemProp, ItemRef                               string
	XMLLang, XMLBase, VirtualKeyboardPolicy                           string

	// Style attribute as a single string
	Style string

	// Map attributes
	Aria   map[string]string // aria-*
	Data   map[string]string // data-*
	Events map[string]string // "onclick" -> "handler()"
	Custom map[string]string // custom attributes like hx-*, x-*, etc.

	// Pointers for tri-state values
	TabIndex                                             *int
	Spellcheck, Translate, Draggable, WritingSuggestions *string

	// Booleans
	Hidden, Inert, Autofocus, ItemScope bool
}

type H1Arg

type H1Arg interface {
	// contains filtered or unexported methods
}

type H1Attrs

type H1Attrs struct {
	Global GlobalAttrs
}

H1

type H2Arg

type H2Arg interface {
	// contains filtered or unexported methods
}

type H2Attrs

type H2Attrs struct {
	Global GlobalAttrs
}

H2

type H3Arg

type H3Arg interface {
	// contains filtered or unexported methods
}

type H3Attrs

type H3Attrs struct {
	Global GlobalAttrs
}

H3

type H4Arg

type H4Arg interface {
	// contains filtered or unexported methods
}

type H4Attrs

type H4Attrs struct {
	Global GlobalAttrs
}

H4

type H5Arg

type H5Arg interface {
	// contains filtered or unexported methods
}

type H5Attrs

type H5Attrs struct {
	Global GlobalAttrs
}

H5

type H6Arg

type H6Arg interface {
	// contains filtered or unexported methods
}

type H6Attrs

type H6Attrs struct {
	Global GlobalAttrs
}

H6

type HasCSS

type HasCSS interface {
	CSS() string
}

HasCSS interface for components that provide CSS

type HasJS

type HasJS interface {
	JS() string
}

HasJS interface for components that provide JavaScript

type HasName

type HasName interface {
	Name() string
}

HasName interface for components that provide explicit names for deduplication

type HeadArg

type HeadArg interface {
	// contains filtered or unexported methods
}

type HeadAttrs

type HeadAttrs struct {
	Global GlobalAttrs
}

type HeadStyleArg

type HeadStyleArg interface {
	// contains filtered or unexported methods
}

type HeadStyleAttrs

type HeadStyleAttrs struct {
	Global GlobalAttrs
	Type   string
	Media  string
}

HeadStyleAttrs attributes for the <style> tag

type HeaderArg

type HeaderArg interface {
	// contains filtered or unexported methods
}

type HeaderAttrs

type HeaderAttrs struct {
	Global GlobalAttrs
}

Header

type HeadersOpt

type HeadersOpt struct {
	// contains filtered or unexported fields
}

func Headers

func Headers(v string) HeadersOpt

type HeightOpt

type HeightOpt struct {
	// contains filtered or unexported fields
}

func Height

func Height(v int) HeightOpt

type HrArg

type HrArg interface {
	// contains filtered or unexported methods
}

type HrAttrs

type HrAttrs struct {
	Global GlobalAttrs
}

HR (void)

type HrefOpt

type HrefOpt struct {
	// contains filtered or unexported fields
}

Tag-specific options

func Href

func Href(v string) HrefOpt

type HreflangOpt

type HreflangOpt struct {
	// contains filtered or unexported fields
}

func Hreflang

func Hreflang(v string) HreflangOpt

type HtmlArg

type HtmlArg interface {
	// contains filtered or unexported methods
}

type HtmlAttrs

type HtmlAttrs struct {
	Global   GlobalAttrs
	Manifest string
	Version  string
	Xmlns    string
}

type HttpEquivOpt

type HttpEquivOpt struct {
	// contains filtered or unexported fields
}

func HttpEquiv

func HttpEquiv(v string) HttpEquivOpt

type IArg

type IArg interface {
	// contains filtered or unexported methods
}

type IAttrs

type IAttrs struct {
	Global GlobalAttrs
}

I

type IframeArg

type IframeArg interface {
	// contains filtered or unexported methods
}

type IframeAttrs

type IframeAttrs struct {
	Global          GlobalAttrs
	Src             string
	Srcdoc          string
	Name            string
	Sandbox         string
	Allow           string
	Allowfullscreen bool
	Width           int
	Height          int
	Loading         string
	Referrerpolicy  string
}

Iframe

type ImgArg

type ImgArg interface {
	// contains filtered or unexported methods
}

type ImgAttrs

type ImgAttrs struct {
	Global   GlobalAttrs
	Src      string
	Alt      string
	Width    int
	Height   int
	Decoding string // "auto"|"async"
	Loading  string // "lazy"|"eager"
}

type InputArg

type InputArg interface {
	// contains filtered or unexported methods
}

type InputAttrs

type InputAttrs struct {
	Global         GlobalAttrs
	Type           string
	Name           string
	Value          string
	Placeholder    string
	Required       bool
	Disabled       bool
	Readonly       bool
	Multiple       bool
	Checked        bool
	Min            string
	Max            string
	Step           string
	Pattern        string
	Size           int
	Maxlength      int
	Minlength      int
	Accept         string
	Form           string
	Formaction     string
	Formenctype    string
	Formmethod     string
	Formnovalidate bool
	Formtarget     string
	List           string
	Autocomplete   string
}

type InputNameOpt

type InputNameOpt struct {
	// contains filtered or unexported fields
}

func InputName

func InputName(v string) InputNameOpt

type InputTypeOpt

type InputTypeOpt struct {
	// contains filtered or unexported fields
}

Input-specific options

func InputType

func InputType(v string) InputTypeOpt

type InputValueOpt

type InputValueOpt struct {
	// contains filtered or unexported fields
}

func InputValue

func InputValue(v string) InputValueOpt

type InsArg

type InsArg interface {
	// contains filtered or unexported methods
}

type InsAttrs

type InsAttrs struct {
	Global   GlobalAttrs
	Cite     string
	Datetime string
}

Ins

type KbdArg

type KbdArg interface {
	// contains filtered or unexported methods
}

type KbdAttrs

type KbdAttrs struct {
	Global GlobalAttrs
}

Kbd

type KindOpt

type KindOpt struct {
	// contains filtered or unexported fields
}

Track-specific options

func Kind

func Kind(v string) KindOpt

type LabelArg

type LabelArg interface {
	// contains filtered or unexported methods
}

type LabelAttrs

type LabelAttrs struct {
	Global GlobalAttrs
	For    string
	Form   string
}

Label

type LabelOpt

type LabelOpt struct {
	// contains filtered or unexported fields
}

func Label

func Label(v string) LabelOpt

type LegendArg

type LegendArg interface {
	// contains filtered or unexported methods
}

type LegendAttrs

type LegendAttrs struct {
	Global GlobalAttrs
}

Legend

type LengthAdjustOpt

type LengthAdjustOpt struct {
	// contains filtered or unexported fields
}

func LengthAdjust

func LengthAdjust(v string) LengthAdjustOpt

type LiArg

type LiArg interface {
	// contains filtered or unexported methods
}

type LiAttrs

type LiAttrs struct {
	Global GlobalAttrs
	Value  int
}

LI (List Item)

type LiComponent added in v0.10.0

type LiComponent Node

Compile-time type safety: Li can be added to Ul and Ol This makes Li() return something that implements both UlArg and OlArg

func Li

func Li(args ...LiArg) LiComponent

type LineArg

type LineArg interface {
	// contains filtered or unexported methods
}

type LineAttrs

type LineAttrs struct {
	Global           GlobalAttrs
	X1               string
	Y1               string
	X2               string
	Y2               string
	PathLength       string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

Line

type LinkArg

type LinkArg interface {
	// contains filtered or unexported methods
}

type LinkAttrs

type LinkAttrs struct {
	Global      GlobalAttrs
	Href        string
	Rel         string
	Type        string
	Media       string
	Hreflang    string
	Sizes       string
	Crossorigin string
}

Link (void)

type LinkComponent added in v0.10.0

type LinkComponent Node
func Link(args ...LinkArg) LinkComponent

type LinkHrefOpt

type LinkHrefOpt struct {
	// contains filtered or unexported fields
}

Link-specific options

func LinkHref

func LinkHref(v string) LinkHrefOpt

type LinkMediaOpt added in v0.10.0

type LinkMediaOpt struct {
	// contains filtered or unexported fields
}

func LinkMedia added in v0.10.0

func LinkMedia(v string) LinkMediaOpt

type LinkRelOpt

type LinkRelOpt struct {
	// contains filtered or unexported fields
}

func LinkRel

func LinkRel(v string) LinkRelOpt

type LinkTypeOpt

type LinkTypeOpt struct {
	// contains filtered or unexported fields
}

func LinkType

func LinkType(v string) LinkTypeOpt

type ListOpt

type ListOpt struct {
	// contains filtered or unexported fields
}

func List

func List(v string) ListOpt

type LoadingOpt

type LoadingOpt struct {
	// contains filtered or unexported fields
}

func Loading

func Loading(v string) LoadingOpt

type LoopOpt

type LoopOpt struct{}

func Loop

func Loop() LoopOpt

type MainArg

type MainArg interface {
	// contains filtered or unexported methods
}

type MainAttrs

type MainAttrs struct {
	Global GlobalAttrs
}

Main

type ManifestOpt

type ManifestOpt struct {
	// contains filtered or unexported fields
}

Tag-specific options

func Manifest

func Manifest(v string) ManifestOpt

type MarkArg

type MarkArg interface {
	// contains filtered or unexported methods
}

type MarkAttrs

type MarkAttrs struct {
	Global GlobalAttrs
}

Mark

type MaxOpt

type MaxOpt struct {
	// contains filtered or unexported fields
}

func Max

func Max(v string) MaxOpt

type MaxlengthOpt

type MaxlengthOpt struct {
	// contains filtered or unexported fields
}

func Maxlength

func Maxlength(v int) MaxlengthOpt

type MediaOpt

type MediaOpt struct {
	// contains filtered or unexported fields
}

Style-specific options

func Media

func Media(v string) MediaOpt

type MetaArg

type MetaArg interface {
	// contains filtered or unexported methods
}

type MetaAttrs

type MetaAttrs struct {
	Global    GlobalAttrs
	Name      string
	Content   string
	HttpEquiv string
	Charset   string
	Property  string
	Scheme    string
}

type MetaComponent added in v0.10.0

type MetaComponent Node

func Meta

func Meta(args ...MetaArg) MetaComponent

type MethodOpt

type MethodOpt struct {
	// contains filtered or unexported fields
}

func Method

func Method(v string) MethodOpt

type MinOpt

type MinOpt struct {
	// contains filtered or unexported fields
}

func Min

func Min(v string) MinOpt

type MinlengthOpt

type MinlengthOpt struct {
	// contains filtered or unexported fields
}

func Minlength

func Minlength(v int) MinlengthOpt

type MultipleOpt

type MultipleOpt struct{}

func Multiple

func Multiple() MultipleOpt

type MutedOpt

type MutedOpt struct{}

func Muted

func Muted() MutedOpt

type NameOpt

type NameOpt struct {
	// contains filtered or unexported fields
}

Tag-specific options

func Name

func Name(v string) NameOpt
type NavArg interface {
	// contains filtered or unexported methods
}
type NavAttrs struct {
	Global GlobalAttrs
}

Nav

type Node

type Node struct {
	Tag       string
	Attrs     any         // must implement attrWriter
	Kids      []Component // empty for void tags
	Void      bool
	AssetCSS  string // CSS to be collected by asset system
	AssetJS   string // JavaScript to be collected by asset system
	AssetName string // Name for asset deduplication
}

func A

func A(args ...AArg) Node

func Abbr

func Abbr(args ...AbbrArg) Node

func Address

func Address(args ...AddressArg) Node

func Article

func Article(args ...ArticleArg) Node

func Aside

func Aside(args ...AsideArg) Node

func Audio

func Audio(args ...AudioArg) Node

func B

func B(args ...BArg) Node

func Blockquote

func Blockquote(args ...BlockquoteArg) Node

func Body

func Body(args ...BodyArg) Node

func Br

func Br(args ...BrArg) Node

func Button

func Button(args ...ButtonArg) Node

func Canvas

func Canvas(args ...CanvasArg) Node

func Caption

func Caption(args ...CaptionArg) Node

func Circle

func Circle(args ...CircleArg) Node

func Citation

func Citation(args ...CitationArg) Node

func Code

func Code(args ...CodeArg) Node

func Col

func Col(args ...ColArg) Node

func Colgroup

func Colgroup(args ...ColgroupArg) Node

func Datalist

func Datalist(args ...DatalistArg) Node

func Dd

func Dd(args ...DdArg) Node

func Defs added in v0.8.0

func Defs(args ...DefsArg) Node

func Del

func Del(args ...DelArg) Node

func Details

func Details(args ...DetailsArg) Node

func Dfn

func Dfn(args ...DfnArg) Node

func Dialog

func Dialog(args ...DialogArg) Node

func Div

func Div(args ...DivArg) Node

func Dl

func Dl(args ...DlArg) Node

func Dt

func Dt(args ...DtArg) Node

func Ellipse

func Ellipse(args ...EllipseArg) Node

func Em

func Em(args ...EmArg) Node

func Fieldset

func Fieldset(args ...FieldsetArg) Node

func Figcaption

func Figcaption(args ...FigcaptionArg) Node

func Figure

func Figure(args ...FigureArg) Node
func Footer(args ...FooterArg) Node

func Form

func Form(args ...FormArg) Node

func FormLabel

func FormLabel(args ...LabelArg) Node

func G

func G(args ...GArg) Node

func H1

func H1(args ...H1Arg) Node

func H2

func H2(args ...H2Arg) Node

func H3

func H3(args ...H3Arg) Node

func H4

func H4(args ...H4Arg) Node

func H5

func H5(args ...H5Arg) Node

func H6

func H6(args ...H6Arg) Node
func Head(args ...HeadArg) Node
func Header(args ...HeaderArg) Node

func Hr

func Hr(args ...HrArg) Node

func Html

func Html(args ...HtmlArg) Node

func I

func I(args ...IArg) Node

func Iframe

func Iframe(args ...IframeArg) Node

func Img

func Img(args ...ImgArg) Node

func Input

func Input(args ...InputArg) Node

func Ins

func Ins(args ...InsArg) Node

func Kbd

func Kbd(args ...KbdArg) Node

func Legend

func Legend(args ...LegendArg) Node

func Line

func Line(args ...LineArg) Node

func Main

func Main(args ...MainArg) Node

func Mark

func Mark(args ...MarkArg) Node
func Nav(args ...NavArg) Node

func Ol

func Ol(args ...OlArg) Node

func P

func P(args ...PArg) Node

func Path

func Path(args ...PathArg) Node

func Polygon

func Polygon(args ...PolygonArg) Node

func Polyline

func Polyline(args ...PolylineArg) Node

func Pre

func Pre(args ...PreArg) Node

func Q

func Q(args ...QArg) Node

func Rect

func Rect(args ...RectArg) Node

func S

func S(args ...SArg) Node

func Samp

func Samp(args ...SampArg) Node

func Section

func Section(args ...SectionArg) Node

func Select

func Select(args ...SelectArg) Node

func Small

func Small(args ...SmallArg) Node

func Source

func Source(args ...SourceArg) Node

func Span

func Span(args ...SpanArg) Node

func Strong

func Strong(args ...StrongArg) Node

func Sub

func Sub(args ...SubArg) Node

func Summary

func Summary(args ...SummaryArg) Node

func Sup

func Sup(args ...SupArg) Node

func Svg

func Svg(args ...SvgArg) Node

func SvgText

func SvgText(args ...SvgTextArg) Node

func Table

func Table(args ...TableArg) Node

func Tbody

func Tbody(args ...TbodyArg) Node

func Td

func Td(args ...TdArg) Node

func Template

func Template(args ...TemplateArg) Node

func Textarea

func Textarea(args ...TextareaArg) Node

func Tfoot

func Tfoot(args ...TfootArg) Node

func Th

func Th(args ...ThArg) Node

func Thead

func Thead(args ...TheadArg) Node

func Time

func Time(args ...TimeArg) Node

func Tr

func Tr(args ...TrArg) Node

func Track

func Track(args ...TrackArg) Node

func U

func U(args ...UArg) Node

func Ul

func Ul(args ...UlArg) Node

func Use added in v0.8.0

func Use(args ...UseArg) Node

func Var

func Var(args ...VarArg) Node

func Video

func Video(args ...VideoArg) Node

func (Node) CSS

func (n Node) CSS() string

func (Node) Children

func (n Node) Children() []Component

Children exposes the node's children for traversals that need to walk the component tree (e.g., asset collection). This enables upstream code to discover nested components without callers having to pass them explicitly.

func (Node) JS

func (n Node) JS() string

func (Node) Name

func (n Node) Name() string

func (Node) WithAssets

func (n Node) WithAssets(css, js, name string) Node

WithAssets returns a copy of the Node with CSS/JS assets attached

type NovalidateOpt

type NovalidateOpt struct{}

func Novalidate

func Novalidate() NovalidateOpt

type OlArg

type OlArg interface {
	// contains filtered or unexported methods
}

type OlAttrs

type OlAttrs struct {
	Global   GlobalAttrs
	Start    int
	Type     string
	Reversed bool
}

OL (Ordered List)

type OpacityOpt

type OpacityOpt struct {
	// contains filtered or unexported fields
}

func Opacity

func Opacity(v string) OpacityOpt

type OpenOpt

type OpenOpt struct{}

Details-specific options

func Open

func Open() OpenOpt

type OptgroupArg

type OptgroupArg interface {
	// contains filtered or unexported methods
}

type OptgroupAttrs

type OptgroupAttrs struct {
	Global   GlobalAttrs
	Label    string
	Disabled bool
}

Optgroup

type OptgroupComponent added in v0.10.0

type OptgroupComponent Node

func Optgroup

func Optgroup(args ...OptgroupArg) OptgroupComponent

type OptionArg

type OptionArg interface {
	// contains filtered or unexported methods
}

type OptionAttrs

type OptionAttrs struct {
	Global   GlobalAttrs
	Value    string
	Selected bool
	Disabled bool
	Label    string
}

Option

type OptionComponent added in v0.10.0

type OptionComponent Node

func Option

func Option(args ...OptionArg) OptionComponent

type OptionValueOpt added in v0.10.0

type OptionValueOpt struct {
	// contains filtered or unexported fields
}

Option-specific options

func OptionValue added in v0.10.0

func OptionValue(v string) OptionValueOpt

type PArg

type PArg interface {
	// contains filtered or unexported methods
}

type PAttrs

type PAttrs struct {
	Global GlobalAttrs
}

type PathArg

type PathArg interface {
	// contains filtered or unexported methods
}

type PathAttrs

type PathAttrs struct {
	Global           GlobalAttrs
	D                string
	PathLength       string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

Path

type PathLengthOpt

type PathLengthOpt struct {
	// contains filtered or unexported fields
}

func PathLength

func PathLength(v string) PathLengthOpt

type PatternOpt

type PatternOpt struct {
	// contains filtered or unexported fields
}

func Pattern

func Pattern(v string) PatternOpt

type PlaceholderOpt

type PlaceholderOpt struct {
	// contains filtered or unexported fields
}

func Placeholder

func Placeholder(v string) PlaceholderOpt

type PointsOpt

type PointsOpt struct {
	// contains filtered or unexported fields
}

Polygon-specific options

func Points

func Points(v string) PointsOpt

type PolygonArg

type PolygonArg interface {
	// contains filtered or unexported methods
}

type PolygonAttrs

type PolygonAttrs struct {
	Global           GlobalAttrs
	Points           string
	PathLength       string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

Polygon

type PolylineArg

type PolylineArg interface {
	// contains filtered or unexported methods
}

type PolylineAttrs

type PolylineAttrs struct {
	Global           GlobalAttrs
	Points           string
	PathLength       string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

Polyline

type PosterOpt

type PosterOpt struct {
	// contains filtered or unexported fields
}

Video-specific options

func Poster

func Poster(v string) PosterOpt

type PreArg

type PreArg interface {
	// contains filtered or unexported methods
}

type PreAttrs

type PreAttrs struct {
	Global GlobalAttrs
}

type PreloadOpt

type PreloadOpt struct {
	// contains filtered or unexported fields
}

func Preload

func Preload(v string) PreloadOpt

type PreserveAspectRatioOpt

type PreserveAspectRatioOpt struct {
	// contains filtered or unexported fields
}

func PreserveAspectRatio

func PreserveAspectRatio(v string) PreserveAspectRatioOpt

type PropertyOpt

type PropertyOpt struct {
	// contains filtered or unexported fields
}

func Property

func Property(v string) PropertyOpt

type QArg

type QArg interface {
	// contains filtered or unexported methods
}

type QAttrs

type QAttrs struct {
	Global GlobalAttrs
	Cite   string
}

Q

type ROpt

type ROpt struct {
	// contains filtered or unexported fields
}

func R

func R(v string) ROpt

type ReadonlyOpt

type ReadonlyOpt struct{}

func Readonly

func Readonly() ReadonlyOpt

type RectArg

type RectArg interface {
	// contains filtered or unexported methods
}

type RectAttrs

type RectAttrs struct {
	Global           GlobalAttrs
	X                string
	Y                string
	Width            string
	Height           string
	Rx               string
	Ry               string
	PathLength       string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

Rect

type RectHeightOpt

type RectHeightOpt struct {
	// contains filtered or unexported fields
}

func RectHeight

func RectHeight(v string) RectHeightOpt

type RectWidthOpt

type RectWidthOpt struct {
	// contains filtered or unexported fields
}

func RectWidth

func RectWidth(v string) RectWidthOpt

type RectXOpt

type RectXOpt struct {
	// contains filtered or unexported fields
}

Rect-specific options

func X

func X(v string) RectXOpt

type RectYOpt

type RectYOpt struct {
	// contains filtered or unexported fields
}

func Y

func Y(v string) RectYOpt

type ReferrerpolicyOpt

type ReferrerpolicyOpt struct {
	// contains filtered or unexported fields
}

func Referrerpolicy

func Referrerpolicy(v string) ReferrerpolicyOpt

type RelOpt

type RelOpt struct {
	// contains filtered or unexported fields
}

func Rel

func Rel(v string) RelOpt

type RequiredOpt

type RequiredOpt struct{}

func Required

func Required() RequiredOpt

type ReversedOpt

type ReversedOpt struct{}

func Reversed

func Reversed() ReversedOpt

type RotateOpt

type RotateOpt struct {
	// contains filtered or unexported fields
}

func Rotate

func Rotate(v string) RotateOpt

type RowsOpt

type RowsOpt struct {
	// contains filtered or unexported fields
}

func Rows

func Rows(v int) RowsOpt

type RowspanOpt

type RowspanOpt struct {
	// contains filtered or unexported fields
}

func Rowspan

func Rowspan(v int) RowspanOpt

type RxOpt

type RxOpt struct {
	// contains filtered or unexported fields
}

func Rx

func Rx(v string) RxOpt

type RyOpt

type RyOpt struct {
	// contains filtered or unexported fields
}

func Ry

func Ry(v string) RyOpt

type SArg

type SArg interface {
	// contains filtered or unexported methods
}

type SAttrs

type SAttrs struct {
	Global GlobalAttrs
}

S

type SampArg

type SampArg interface {
	// contains filtered or unexported methods
}

type SampAttrs

type SampAttrs struct {
	Global GlobalAttrs
}

Samp

type SandboxOpt

type SandboxOpt struct {
	// contains filtered or unexported fields
}

func Sandbox

func Sandbox(v string) SandboxOpt

type SchemeOpt

type SchemeOpt struct {
	// contains filtered or unexported fields
}

func Scheme

func Scheme(v string) SchemeOpt

type ScopeOpt

type ScopeOpt struct {
	// contains filtered or unexported fields
}

Th-specific options

func Scope

func Scope(v string) ScopeOpt

type ScriptArg

type ScriptArg interface {
	// contains filtered or unexported methods
}

type ScriptAttrs

type ScriptAttrs struct {
	Global GlobalAttrs
	Src    string
	Type   string
	Async  bool
	Defer  bool
}

Script

type ScriptComponent added in v0.10.0

type ScriptComponent Node

func Script

func Script(args ...ScriptArg) ScriptComponent

type ScriptSrcOpt

type ScriptSrcOpt struct {
	// contains filtered or unexported fields
}

func ScriptSrc

func ScriptSrc(v string) ScriptSrcOpt

type ScriptTypeOpt added in v0.10.0

type ScriptTypeOpt struct {
	// contains filtered or unexported fields
}

func ScriptType added in v0.10.0

func ScriptType(v string) ScriptTypeOpt

type SectionArg

type SectionArg interface {
	// contains filtered or unexported methods
}

type SectionAttrs

type SectionAttrs struct {
	Global GlobalAttrs
}

Section

type SelectArg

type SelectArg interface {
	// contains filtered or unexported methods
}

type SelectAttrs

type SelectAttrs struct {
	Global       GlobalAttrs
	Name         string
	Multiple     bool
	Required     bool
	Disabled     bool
	Size         int
	Form         string
	Autocomplete string
}

Select

type SelectNameOpt added in v0.10.0

type SelectNameOpt struct {
	// contains filtered or unexported fields
}

Select-specific options

func SelectName added in v0.10.0

func SelectName(v string) SelectNameOpt

type SelectedOpt

type SelectedOpt struct{}

func Selected

func Selected() SelectedOpt

type SizeOpt

type SizeOpt struct {
	// contains filtered or unexported fields
}

func Size

func Size(v int) SizeOpt

type SizesOpt

type SizesOpt struct {
	// contains filtered or unexported fields
}

func Sizes

func Sizes(v string) SizesOpt

type SmallArg

type SmallArg interface {
	// contains filtered or unexported methods
}

type SmallAttrs

type SmallAttrs struct {
	Global GlobalAttrs
}

Small

type SourceArg

type SourceArg interface {
	// contains filtered or unexported methods
}

type SourceAttrs

type SourceAttrs struct {
	Global GlobalAttrs
	Src    string
	Type   string
	Media  string
	Sizes  string
	Srcset string
}

Source (void)

type SpanArg

type SpanArg interface {
	// contains filtered or unexported methods
}

type SpanAttrs

type SpanAttrs struct {
	Global GlobalAttrs
}

type SpanOpt

type SpanOpt struct {
	// contains filtered or unexported fields
}

func SpanAttr

func SpanAttr(v int) SpanOpt

type SrcOpt

type SrcOpt struct {
	// contains filtered or unexported fields
}

Tag-specific options

func Src

func Src(v string) SrcOpt

type SrcdocOpt

type SrcdocOpt struct {
	// contains filtered or unexported fields
}

func Srcdoc

func Srcdoc(v string) SrcdocOpt

type SrclangOpt

type SrclangOpt struct {
	// contains filtered or unexported fields
}

func Srclang

func Srclang(v string) SrclangOpt

type SrcsetOpt

type SrcsetOpt struct {
	// contains filtered or unexported fields
}

Source-specific options

func Srcset

func Srcset(v string) SrcsetOpt

type StartOpt

type StartOpt struct {
	// contains filtered or unexported fields
}

OL-specific options

func Start

func Start(v int) StartOpt

type StepOpt

type StepOpt struct {
	// contains filtered or unexported fields
}

func Step

func Step(v string) StepOpt

type StrokeDasharrayOpt

type StrokeDasharrayOpt struct {
	// contains filtered or unexported fields
}

func StrokeDasharray

func StrokeDasharray(v string) StrokeDasharrayOpt

type StrokeDashoffsetOpt

type StrokeDashoffsetOpt struct {
	// contains filtered or unexported fields
}

func StrokeDashoffset

func StrokeDashoffset(v string) StrokeDashoffsetOpt

type StrokeLinecapOpt

type StrokeLinecapOpt struct {
	// contains filtered or unexported fields
}

func StrokeLinecap

func StrokeLinecap(v string) StrokeLinecapOpt

type StrokeLinejoinOpt

type StrokeLinejoinOpt struct {
	// contains filtered or unexported fields
}

func StrokeLinejoin

func StrokeLinejoin(v string) StrokeLinejoinOpt

type StrokeMiterlimitOpt

type StrokeMiterlimitOpt struct {
	// contains filtered or unexported fields
}

func StrokeMiterlimit

func StrokeMiterlimit(v string) StrokeMiterlimitOpt

type StrokeOpacityOpt

type StrokeOpacityOpt struct {
	// contains filtered or unexported fields
}

func StrokeOpacity

func StrokeOpacity(v string) StrokeOpacityOpt

type StrokeOpt

type StrokeOpt struct {
	// contains filtered or unexported fields
}

func Stroke

func Stroke(v string) StrokeOpt

type StrokeWidthOpt

type StrokeWidthOpt struct {
	// contains filtered or unexported fields
}

func StrokeWidth

func StrokeWidth(v string) StrokeWidthOpt

type StrongArg

type StrongArg interface {
	// contains filtered or unexported methods
}

type StrongAttrs

type StrongAttrs struct {
	Global GlobalAttrs
}

Strong

type StyleComponent added in v0.10.0

type StyleComponent Node

func HeadStyle

func HeadStyle(args ...HeadStyleArg) StyleComponent

type StyleTypeOpt added in v0.10.0

type StyleTypeOpt struct {
	// contains filtered or unexported fields
}

func StyleType added in v0.10.0

func StyleType(v string) StyleTypeOpt

type SubArg

type SubArg interface {
	// contains filtered or unexported methods
}

type SubAttrs

type SubAttrs struct {
	Global GlobalAttrs
}

Sub

type SummaryArg

type SummaryArg interface {
	// contains filtered or unexported methods
}

type SummaryAttrs

type SummaryAttrs struct {
	Global GlobalAttrs
}

Summary

type SupArg

type SupArg interface {
	// contains filtered or unexported methods
}

type SupAttrs

type SupAttrs struct {
	Global GlobalAttrs
}

Sup

type SvgArg

type SvgArg interface {
	// contains filtered or unexported methods
}

type SvgAttrs

type SvgAttrs struct {
	Global              GlobalAttrs
	Width               string
	Height              string
	ViewBox             string
	PreserveAspectRatio string
	Xmlns               string
	Version             string
	BaseProfile         string
	ContentScriptType   string
	ContentStyleType    string
	ZoomAndPan          string
	X                   string
	Y                   string
	Fill                string
	FillOpacity         string
	FillRule            string
	Stroke              string
	StrokeWidth         string
	StrokeDasharray     string
	StrokeDashoffset    string
	StrokeLinecap       string
	StrokeLinejoin      string
	StrokeOpacity       string
	StrokeMiterlimit    string
	Transform           string
	Opacity             string
}

Svg

type SvgHeightOpt

type SvgHeightOpt struct {
	// contains filtered or unexported fields
}

func SvgHeight

func SvgHeight(v string) SvgHeightOpt

type SvgTextArg

type SvgTextArg interface {
	// contains filtered or unexported methods
}

type SvgTextAttrs

type SvgTextAttrs struct {
	Global           GlobalAttrs
	X                string
	Y                string
	Dx               string
	Dy               string
	Rotate           string
	TextLength       string
	LengthAdjust     string
	DominantBaseline string
	TextAnchor       string
	FontFamily       string
	FontSize         string
	FontWeight       string
	FontStyle        string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Transform        string
	Opacity          string
}

SvgText

type SvgTextXOpt

type SvgTextXOpt struct {
	// contains filtered or unexported fields
}

SvgText-specific options

func SvgTextX

func SvgTextX(v string) SvgTextXOpt

type SvgTextYOpt

type SvgTextYOpt struct {
	// contains filtered or unexported fields
}

func SvgTextY

func SvgTextY(v string) SvgTextYOpt

type SvgWidthOpt

type SvgWidthOpt struct {
	// contains filtered or unexported fields
}

func SvgWidth

func SvgWidth(v string) SvgWidthOpt

type SvgXOpt

type SvgXOpt struct {
	// contains filtered or unexported fields
}

func SvgX

func SvgX(v string) SvgXOpt

type SvgYOpt

type SvgYOpt struct {
	// contains filtered or unexported fields
}

func SvgY

func SvgY(v string) SvgYOpt

type TableArg

type TableArg interface {
	// contains filtered or unexported methods
}

type TableAttrs

type TableAttrs struct {
	Global GlobalAttrs
}

Table

type TargetOpt

type TargetOpt struct {
	// contains filtered or unexported fields
}

func Target

func Target(v ATarget) TargetOpt

type TbodyArg

type TbodyArg interface {
	// contains filtered or unexported methods
}

type TbodyAttrs

type TbodyAttrs struct {
	Global GlobalAttrs
}

Tbody

type TdArg

type TdArg interface {
	// contains filtered or unexported methods
}

type TdAttrs

type TdAttrs struct {
	Global  GlobalAttrs
	Colspan int
	Rowspan int
	Headers string
}

Td

type TemplateArg

type TemplateArg interface {
	// contains filtered or unexported methods
}

type TemplateAttrs

type TemplateAttrs struct {
	Global GlobalAttrs
}

Template

type TextAnchorOpt

type TextAnchorOpt struct {
	// contains filtered or unexported fields
}

func TextAnchor

func TextAnchor(v string) TextAnchorOpt

type TextLengthOpt

type TextLengthOpt struct {
	// contains filtered or unexported fields
}

func TextLength

func TextLength(v string) TextLengthOpt

type TextNode

type TextNode string

type TextareaArg

type TextareaArg interface {
	// contains filtered or unexported methods
}

type TextareaAttrs

type TextareaAttrs struct {
	Global      GlobalAttrs
	Name        string
	Rows        int
	Cols        int
	Placeholder string
	Required    bool
	Disabled    bool
	Readonly    bool
	Maxlength   int
	Minlength   int
	Wrap        string
	Form        string
}

Textarea

type TextareaNameOpt

type TextareaNameOpt struct {
	// contains filtered or unexported fields
}

Textarea-specific options

func TextareaName

func TextareaName(v string) TextareaNameOpt

type TfootArg

type TfootArg interface {
	// contains filtered or unexported methods
}

type TfootAttrs

type TfootAttrs struct {
	Global GlobalAttrs
}

Tfoot

type ThArg

type ThArg interface {
	// contains filtered or unexported methods
}

type ThAttrs

type ThAttrs struct {
	Global  GlobalAttrs
	Colspan int
	Rowspan int
	Headers string
	Scope   string
}

Th

type TheadArg

type TheadArg interface {
	// contains filtered or unexported methods
}

type TheadAttrs

type TheadAttrs struct {
	Global GlobalAttrs
}

Thead

type TimeArg

type TimeArg interface {
	// contains filtered or unexported methods
}

type TimeAttrs

type TimeAttrs struct {
	Global   GlobalAttrs
	Datetime string
}

Time

type TitleArg

type TitleArg interface {
	// contains filtered or unexported methods
}

type TitleAttrs

type TitleAttrs struct {
	Global GlobalAttrs
}

type TitleComponent added in v0.10.0

type TitleComponent Node

func HeadTitle

func HeadTitle(args ...TitleArg) TitleComponent

type TrArg

type TrArg interface {
	// contains filtered or unexported methods
}

type TrAttrs

type TrAttrs struct {
	Global GlobalAttrs
}

Tr

type TrackArg

type TrackArg interface {
	// contains filtered or unexported methods
}

type TrackAttrs

type TrackAttrs struct {
	Global  GlobalAttrs
	Kind    string
	Src     string
	Srclang string
	Label   string
	Default bool
}

Track (void)

type TransformOpt

type TransformOpt struct {
	// contains filtered or unexported fields
}

func Transform

func Transform(v string) TransformOpt

type TxtOpt

type TxtOpt struct {
	// contains filtered or unexported fields
}

Non-global content helpers (unified for all tags that accept children)

func T

func T(s string) TxtOpt

T is an alias for Text to reduce verbosity

func Text

func Text(s string) TxtOpt

type TypeOpt

type TypeOpt struct {
	// contains filtered or unexported fields
}

func Type

func Type(v string) TypeOpt

type UArg

type UArg interface {
	// contains filtered or unexported methods
}

type UAttrs

type UAttrs struct {
	Global GlobalAttrs
}

U

type UlArg

type UlArg interface {
	// contains filtered or unexported methods
}

type UlAttrs

type UlAttrs struct {
	Global GlobalAttrs
}

UL (Unordered List)

type UnsafeTextNode

type UnsafeTextNode string

type UnsafeTxtOpt

type UnsafeTxtOpt struct {
	// contains filtered or unexported fields
}

func UnsafeText

func UnsafeText(s string) UnsafeTxtOpt

type UseArg added in v0.8.0

type UseArg interface {
	// contains filtered or unexported methods
}

type UseAttrs added in v0.8.0

type UseAttrs struct {
	Global           GlobalAttrs
	Href             string
	X                string
	Y                string
	Width            string
	Height           string
	Transform        string
	Fill             string
	FillOpacity      string
	FillRule         string
	Stroke           string
	StrokeWidth      string
	StrokeDasharray  string
	StrokeDashoffset string
	StrokeLinecap    string
	StrokeLinejoin   string
	StrokeOpacity    string
	StrokeMiterlimit string
	Opacity          string
}

Use

type UseHeightOpt added in v0.8.0

type UseHeightOpt struct {
	// contains filtered or unexported fields
}

func UseHeight added in v0.8.0

func UseHeight(v string) UseHeightOpt

type UseWidthOpt added in v0.8.0

type UseWidthOpt struct {
	// contains filtered or unexported fields
}

func UseWidth added in v0.8.0

func UseWidth(v string) UseWidthOpt

type UseXOpt added in v0.8.0

type UseXOpt struct {
	// contains filtered or unexported fields
}

Use-specific options

func UseX added in v0.8.0

func UseX(v string) UseXOpt

type UseYOpt added in v0.8.0

type UseYOpt struct {
	// contains filtered or unexported fields
}

func UseY added in v0.8.0

func UseY(v string) UseYOpt

type ValueOpt

type ValueOpt struct {
	// contains filtered or unexported fields
}

LI-specific options

func Value

func Value(v int) ValueOpt

type VarArg

type VarArg interface {
	// contains filtered or unexported methods
}

type VarAttrs

type VarAttrs struct {
	Global GlobalAttrs
}

Var

type VersionOpt

type VersionOpt struct {
	// contains filtered or unexported fields
}

func Version

func Version(v string) VersionOpt

type VideoArg

type VideoArg interface {
	// contains filtered or unexported methods
}

type VideoAttrs

type VideoAttrs struct {
	Global      GlobalAttrs
	Src         string
	Poster      string
	Preload     string
	Autoplay    bool
	Loop        bool
	Muted       bool
	Controls    bool
	Width       int
	Height      int
	Crossorigin string
}

Video

type ViewBoxOpt

type ViewBoxOpt struct {
	// contains filtered or unexported fields
}

SVG-specific options

func ViewBox

func ViewBox(v string) ViewBoxOpt

type WidthOpt

type WidthOpt struct {
	// contains filtered or unexported fields
}

func Width

func Width(v int) WidthOpt

type WrapOpt

type WrapOpt struct {
	// contains filtered or unexported fields
}

func Wrap

func Wrap(v string) WrapOpt

type X1Opt

type X1Opt struct {
	// contains filtered or unexported fields
}

Line-specific options

func X1

func X1(v string) X1Opt

type X2Opt

type X2Opt struct {
	// contains filtered or unexported fields
}

func X2

func X2(v string) X2Opt

type XmlnsOpt

type XmlnsOpt struct {
	// contains filtered or unexported fields
}

func Xmlns

func Xmlns(v string) XmlnsOpt

type Y1Opt

type Y1Opt struct {
	// contains filtered or unexported fields
}

func Y1

func Y1(v string) Y1Opt

type Y2Opt

type Y2Opt struct {
	// contains filtered or unexported fields
}

func Y2

func Y2(v string) Y2Opt

type ZoomAndPanOpt

type ZoomAndPanOpt struct {
	// contains filtered or unexported fields
}

func ZoomAndPan

func ZoomAndPan(v string) ZoomAndPanOpt

Jump to

Keyboard shortcuts

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