Documentation
¶
Overview ¶
Package html provides semantic, ADA-compliant HTML element primitives for the GoFastr core-ui framework.
The package maps 1:1 to HTML tags: every exported function produces a single element (Div, Button, Heading, Form, Table…). Higher-level patterns that compose multiple elements (accordion, pagination, tabs, breadcrumbs, etc.) live in core-ui/patterns; opinionated semantic components live in framework/ui.
Every function returns a render.HTML value and uses the core render package's Tag and VoidTag builders to produce well-formed markup. ARIA landmarks and roles are applied automatically where appropriate.
Usage ¶
Elements accept an Attrs map (which may be nil) and variadic children:
heading := html.Heading(2, html.Attrs{"class": "title"},
render.Text("Welcome"))
// <h2 class="title" id="heading-welcome">Welcome</h2>
Index ¶
- Constants
- func Abbr(cfg AbbrConfig, children ...render.HTML) render.HTML
- func Article(cfg ArticleConfig, children ...render.HTML) render.HTML
- func Aside(cfg AsideConfig, children ...render.HTML) render.HTML
- func Audio(cfg AudioConfig, children ...render.HTML) render.HTML
- func BR() render.HTML
- func Blockquote(cfg TextConfig, children ...render.HTML) render.HTML
- func Button(cfg ButtonConfig) render.HTML
- func ButtonGroup(cfg ButtonGroupConfig, children ...render.HTML) render.HTML
- func Caption(cfg CaptionConfig, children ...render.HTML) render.HTML
- func Checkbox(cfg CheckboxConfig) render.HTML
- func Cite(cfg TextConfig, children ...render.HTML) render.HTML
- func Code(cfg TextConfig, children ...render.HTML) render.HTML
- func DescriptionDetail(cfg TextConfig, children ...render.HTML) render.HTML
- func DescriptionList(cfg TextConfig, children ...render.HTML) render.HTML
- func DescriptionTerm(cfg TextConfig, children ...render.HTML) render.HTML
- func Details(cfg DetailsConfig, children ...render.HTML) render.HTML
- func Div(cfg DivConfig, children ...render.HTML) render.HTML
- func Em(cfg TextConfig, children ...render.HTML) render.HTML
- func FieldSet(cfg FieldSetConfig, children ...render.HTML) render.HTML
- func FigCaption(cfg FigCaptionConfig, children ...render.HTML) render.HTML
- func Figure(cfg FigureConfig, children ...render.HTML) render.HTML
- func Footer(cfg FooterConfig, children ...render.HTML) render.HTML
- func Form(cfg FormConfig, children ...render.HTML) render.HTML
- func Group(cfg GroupConfig, children ...render.HTML) render.HTML
- func HR(cfg TextConfig) render.HTML
- func Header(cfg HeaderConfig, children ...render.HTML) render.HTML
- func Heading(cfg HeadingConfig, children ...render.HTML) render.HTML
- func Image(cfg ImageConfig) render.HTML
- func Input(cfg InputConfig) render.HTML
- func Kbd(cfg TextConfig, children ...render.HTML) render.HTML
- func Label(cfg LabelConfig) render.HTML
- func Legend(cfg TextConfig, children ...render.HTML) render.HTML
- func Link(cfg LinkConfig) render.HTML
- func LinkHTML(cfg LinkHTMLConfig) render.HTML
- func ListItem(cfg ListItemConfig, children ...render.HTML) render.HTML
- func Main(cfg MainConfig, children ...render.HTML) render.HTML
- func Mark(cfg TextConfig, children ...render.HTML) render.HTML
- func Meta(name, content string) render.HTML
- func Nav(cfg NavConfig, children ...render.HTML) render.HTML
- func Option(value, text string, selected bool) render.HTML
- func OrderedList(cfg ListConfig, children ...render.HTML) render.HTML
- func Paragraph(cfg TextConfig, children ...render.HTML) render.HTML
- func Pre(cfg TextConfig, children ...render.HTML) render.HTML
- func Radio(cfg RadioConfig) render.HTML
- func Script(src string) render.HTML
- func Section(cfg SectionConfig, children ...render.HTML) render.HTML
- func Select(cfg SelectConfig) render.HTML
- func Small(cfg TextConfig, children ...render.HTML) render.HTML
- func Source(cfg SourceConfig) render.HTML
- func Span(cfg TextConfig, children ...render.HTML) render.HTML
- func Strong(cfg TextConfig, children ...render.HTML) render.HTML
- func StyleSheet(href string) render.HTML
- func Summary(cfg SummaryConfig, children ...render.HTML) render.HTML
- func TD(cfg TDConfig, children ...render.HTML) render.HTML
- func TH(cfg THConfig, children ...render.HTML) render.HTML
- func Table(cfg TableConfig, children ...render.HTML) render.HTML
- func TableRow(cfg TableRowConfig, children ...render.HTML) render.HTML
- func Tbody(cfg TableSectionConfig, children ...render.HTML) render.HTML
- func TextArea(cfg TextAreaConfig) render.HTML
- func Tfoot(cfg TableSectionConfig, children ...render.HTML) render.HTML
- func Thead(cfg TableSectionConfig, children ...render.HTML) render.HTML
- func Time(cfg TimeConfig, children ...render.HTML) render.HTML
- func UnorderedList(cfg ListConfig, children ...render.HTML) render.HTML
- func Video(cfg VideoConfig, children ...render.HTML) render.HTML
- type AbbrConfig
- type ArticleConfig
- type AsideConfig
- type Attrs
- func Aria(key, value string) Attrs
- func Bind(key string) Attrs
- func Classes(classes map[string]bool) Attrs
- func ContainerType(containerType string, name string) Attrs
- func DataAttrs(data map[string]string) Attrs
- func ID(id string) Attrs
- func MergeAttrs(attrsList ...Attrs) Attrs
- func OnChange(action string) Attrs
- func OnClick(action string) Attrs
- func OnInput(action string) Attrs
- func OnSubmit(action string) Attrs
- type AudioConfig
- type ButtonConfig
- type ButtonGroupConfig
- type CaptionConfig
- type CheckboxConfig
- type DetailsConfig
- type DivConfig
- type FieldSetConfig
- type FigCaptionConfig
- type FigureConfig
- type FooterConfig
- type FormConfig
- type GroupConfig
- type HeaderConfig
- type HeadingConfig
- type ImageConfig
- type InputConfig
- type LabelConfig
- type LinkConfig
- type LinkHTMLConfig
- type ListConfig
- type ListItemConfig
- type MainConfig
- type NavConfig
- type RadioConfig
- type SectionConfig
- type SelectConfig
- type SelectOption
- type SourceConfig
- type SummaryConfig
- type TDConfig
- type THConfig
- type TableConfig
- type TableRowConfig
- type TableSectionConfig
- type TextAreaConfig
- type TextConfig
- type TimeConfig
- type VideoConfig
Constants ¶
const ( RoleBanner = "banner" RoleMain = "main" RoleContentinfo = "contentinfo" RoleComplementary = "complementary" RoleSearch = "search" RoleForm = "form" RoleRegion = "region" )
Landmark roles.
const ( RoleDialog = "dialog" RoleAlert = "alert" RoleAlertDialog = "alertdialog" RoleStatus = "status" RoleLog = "log" RoleMarquee = "marquee" RoleTimer = "timer" )
Live region roles.
const ( RoleButton = "button" RoleLink = "link" RoleCheckbox = "checkbox" RoleRadio = "radio" RoleTab = "tab" RoleTabList = "tablist" RoleTabPanel = "tabpanel" )
Widget roles.
const ( RoleGrid = "grid" RoleGridCell = "gridcell" RoleRow = "row" RoleRowGroup = "rowgroup" RoleTable = "table" )
Grid and table roles.
const ( RoleList = "list" RoleListItem = "listitem" RoleListbox = "listbox" RoleOption = "option" RoleMenu = "menu" RoleMenuItem = "menuitem" )
List and menu roles.
Variables ¶
This section is empty.
Functions ¶
func Abbr ¶
func Abbr(cfg AbbrConfig, children ...render.HTML) render.HTML
Abbr produces an <abbr> element with a title attribute for the full expansion of the abbreviation. Required: Title.
func Article ¶
func Article(cfg ArticleConfig, children ...render.HTML) render.HTML
Article produces an <article> element representing a self-contained composition in a page.
func Aside ¶
func Aside(cfg AsideConfig, children ...render.HTML) render.HTML
Aside produces an <aside> element with role="complementary". Required: Label or LabelledBy.
func Audio ¶
func Audio(cfg AudioConfig, children ...render.HTML) render.HTML
Audio produces an <audio> element for sound content.
func Blockquote ¶
func Blockquote(cfg TextConfig, children ...render.HTML) render.HTML
Blockquote produces a <blockquote> element.
func Button ¶
func Button(cfg ButtonConfig) render.HTML
Button produces a <button> element. Required: Label (used as both visible text and aria-label).
func ButtonGroup ¶
func ButtonGroup(cfg ButtonGroupConfig, children ...render.HTML) render.HTML
ButtonGroup produces a <div> with role="group" containing buttons.
func Caption ¶
func Caption(cfg CaptionConfig, children ...render.HTML) render.HTML
Caption produces a <caption> element for a table description.
func Checkbox ¶
func Checkbox(cfg CheckboxConfig) render.HTML
Checkbox produces an <input type="checkbox"> element. Required: Name.
func Cite ¶
func Cite(cfg TextConfig, children ...render.HTML) render.HTML
Cite produces a <cite> element for the title of a work.
func Code ¶
func Code(cfg TextConfig, children ...render.HTML) render.HTML
Code produces a <code> element for inline code fragments.
func DescriptionDetail ¶
func DescriptionDetail(cfg TextConfig, children ...render.HTML) render.HTML
DescriptionDetail produces a <dd> element for a description in a description list.
func DescriptionList ¶
func DescriptionList(cfg TextConfig, children ...render.HTML) render.HTML
DescriptionList produces a <dl> element for name-value groups.
func DescriptionTerm ¶
func DescriptionTerm(cfg TextConfig, children ...render.HTML) render.HTML
DescriptionTerm produces a <dt> element for a term in a description list.
func Details ¶
func Details(cfg DetailsConfig, children ...render.HTML) render.HTML
Details produces a <details> element for a disclosure widget.
func Em ¶
func Em(cfg TextConfig, children ...render.HTML) render.HTML
Em produces an <em> element for stress emphasis.
func FieldSet ¶
func FieldSet(cfg FieldSetConfig, children ...render.HTML) render.HTML
FieldSet produces a <fieldset> element with a <legend> derived from cfg.Legend. Required: Legend.
func FigCaption ¶
func FigCaption(cfg FigCaptionConfig, children ...render.HTML) render.HTML
FigCaption produces a <figcaption> element for a figure caption.
func Figure ¶
func Figure(cfg FigureConfig, children ...render.HTML) render.HTML
Figure produces a <figure> element for self-contained content referenced from the main flow.
func Footer ¶
func Footer(cfg FooterConfig, children ...render.HTML) render.HTML
Footer produces a <footer> element. When cfg.ContentInfo is true it also carries role="contentinfo" (use this for the page-wide footer only; nested article/section footers should leave it false).
func Form ¶
func Form(cfg FormConfig, children ...render.HTML) render.HTML
Form produces a <form> element. Required: Method.
func Group ¶
func Group(cfg GroupConfig, children ...render.HTML) render.HTML
Group produces a <div> element with the given ARIA role. Required: Role.
func Header ¶
func Header(cfg HeaderConfig, children ...render.HTML) render.HTML
Header produces a <header> element. When cfg.Banner is true it also carries role="banner" (use this for the page-wide banner only; nested page-content headers should leave Banner=false).
func Heading ¶
func Heading(cfg HeadingConfig, children ...render.HTML) render.HTML
Heading produces an <h1> through <h6> element. Required: Level (1-6). Auto-generates an id attribute from the text content of children for aria-labelledby references. If cfg.ID is set, it is used instead.
func Image ¶
func Image(cfg ImageConfig) render.HTML
Image produces a void <img> element. Required: Src and Alt. Empty Alt marks the image as decorative (role="presentation" is added automatically).
func Input ¶
func Input(cfg InputConfig) render.HTML
Input produces a void <input> element. Required: Type and Name.
func Kbd ¶
func Kbd(cfg TextConfig, children ...render.HTML) render.HTML
Kbd produces a <kbd> element for keyboard input — a single key, a chord, or a sequence. Pairs with framework/ui.ShortcutHint for rendering shortcut chips. Pure semantic markup, no scripting.
func Label ¶
func Label(cfg LabelConfig) render.HTML
Label produces a <label> element with a for attribute linking it to the form control with the given ID. Required: For and Text.
func Legend ¶
func Legend(cfg TextConfig, children ...render.HTML) render.HTML
Legend produces a <legend> element.
func Link ¶
func Link(cfg LinkConfig) render.HTML
Link produces an <a> element with the given href and text content. Required: Href and Text.
func LinkHTML ¶
func LinkHTML(cfg LinkHTMLConfig) render.HTML
LinkHTML produces an <a> element with raw HTML content (not escaped). Required: Href and Content.
func ListItem ¶
func ListItem(cfg ListItemConfig, children ...render.HTML) render.HTML
ListItem produces an <li> element with role="listitem".
func Main ¶
func Main(cfg MainConfig, children ...render.HTML) render.HTML
Main produces a <main> element with role="main" and id="main-content" for skip-navigation links. If cfg.ID is set, it overrides the default id.
func Mark ¶
func Mark(cfg TextConfig, children ...render.HTML) render.HTML
Mark produces a <mark> element for highlighted text.
func OrderedList ¶
func OrderedList(cfg ListConfig, children ...render.HTML) render.HTML
OrderedList produces an <ol> element with role="list".
func Paragraph ¶
func Paragraph(cfg TextConfig, children ...render.HTML) render.HTML
Paragraph produces a <p> element.
func Pre ¶
func Pre(cfg TextConfig, children ...render.HTML) render.HTML
Pre produces a <pre> element for preformatted text.
func Radio ¶
func Radio(cfg RadioConfig) render.HTML
Radio produces an <input type="radio"> element. Required: Name and Value.
func Section ¶
func Section(cfg SectionConfig, children ...render.HTML) render.HTML
Section produces a <section> element. Required: Label or LabelledBy. Automatically adds role="region" and the corresponding aria attribute.
func Select ¶
func Select(cfg SelectConfig) render.HTML
Select produces a <select> element containing the given options. Required: Name.
func Small ¶
func Small(cfg TextConfig, children ...render.HTML) render.HTML
Small produces a <small> element for side comments.
func Source ¶
func Source(cfg SourceConfig) render.HTML
Source produces a void <source> element for use inside <audio> or <video>. Required: Src and Type.
func Span ¶
func Span(cfg TextConfig, children ...render.HTML) render.HTML
Span produces a <span> element.
func Strong ¶
func Strong(cfg TextConfig, children ...render.HTML) render.HTML
Strong produces a <strong> element for strong importance.
func StyleSheet ¶
StyleSheet produces a <link> element with rel="stylesheet".
func Summary ¶
func Summary(cfg SummaryConfig, children ...render.HTML) render.HTML
Summary produces a <summary> element for the summary/caption of a details element.
func TH ¶
TH produces a <th> element. The scope attribute defaults to "col" (columnheader) unless cfg.Scope is set. The role is set to "columnheader" for scope="col" and "rowheader" for scope="row".
func Table ¶
func Table(cfg TableConfig, children ...render.HTML) render.HTML
Table produces a <table> element with role="table".
func TableRow ¶
func TableRow(cfg TableRowConfig, children ...render.HTML) render.HTML
TableRow produces a <tr> element with role="row".
func Tbody ¶
func Tbody(cfg TableSectionConfig, children ...render.HTML) render.HTML
Tbody produces a <tbody> element with role="rowgroup".
func TextArea ¶
func TextArea(cfg TextAreaConfig) render.HTML
TextArea produces a <textarea> element. Required: Name. Content is HTML-escaped on render; for unescaped content (rare) drop to render.Tag("textarea", ...) directly.
func Tfoot ¶
func Tfoot(cfg TableSectionConfig, children ...render.HTML) render.HTML
Tfoot produces a <tfoot> element with role="rowgroup".
func Thead ¶
func Thead(cfg TableSectionConfig, children ...render.HTML) render.HTML
Thead produces a <thead> element with role="rowgroup".
func Time ¶
func Time(cfg TimeConfig, children ...render.HTML) render.HTML
Time produces a <time> element with a machine-readable datetime attribute. Required: Datetime.
func UnorderedList ¶
func UnorderedList(cfg ListConfig, children ...render.HTML) render.HTML
UnorderedList produces a <ul> element with role="list".
Types ¶
type AbbrConfig ¶
type AbbrConfig struct {
Title string // required: full expansion
Class string
ID string
ExtraAttrs Attrs
}
AbbrConfig configures an <abbr> element. Required: Title.
type ArticleConfig ¶
ArticleConfig configures an <article> element. No required fields.
type AsideConfig ¶
type AsideConfig struct {
Label string // required → aria-label
LabelledBy string // alternative → aria-labelledby
Class string
ID string
ExtraAttrs Attrs
}
AsideConfig configures an <aside> element. Required: Label or LabelledBy (one must be set). Automatically adds role="complementary".
type Attrs ¶
Attrs is a type alias for map[string]string, matching render.Attrs.
func Aria ¶
Aria returns an Attrs containing a single aria-* attribute. The key should not include the "aria-" prefix; it is added automatically.
func Bind ¶
Bind returns Attrs that create a two-way binding between an input element and a named state key. The runtime.js listens for input events on elements with data-bind and dispatches actions with the new value.
Usage:
search := signal.New("")
html.Input(html.Text, "search",
html.Bind("search"),
html.Placeholder("Search..."),
)
func Classes ¶
Classes converts a map of class names to booleans into an Attrs containing a single "class" attribute. Only classes with a true value are included.
func ContainerType ¶
ContainerType returns Attrs that declare an element as a CSS container query context. The containerType is typically "inline-size" (respond to width) or "size" (width + height). Use this on parent elements whose children should respond to the parent's size.
html.Div(
html.ContainerType("inline-size", "product-grid"),
productCards...,
)
func DataAttrs ¶
DataAttrs converts a map of key-value pairs into data-* attributes. Keys should not include the "data-" prefix; it is added automatically.
func MergeAttrs ¶
MergeAttrs merges zero or more attribute maps. Later maps overwrite earlier ones for the same key. Returns nil if no maps are provided.
func OnChange ¶
OnChange returns Attrs with data-action set and data-action-type="change". Used on select/input elements for change handling.
func OnClick ¶
OnClick returns Attrs with data-action set to the given action name. Used to wire up click handlers on html. Example: Button("Save", OnClick("save"))
type AudioConfig ¶
AudioConfig configures an <audio> element. No required fields.
type ButtonConfig ¶
type ButtonConfig struct {
Label string // required → text content AND aria-label
Type string // defaults to "button"
Class string
ID string
ExtraAttrs Attrs
}
ButtonConfig configures a <button> element. Required: Label (used as both visible text and aria-label).
type ButtonGroupConfig ¶
ButtonGroupConfig configures a <div> with role="group" containing buttons. No required fields.
type CaptionConfig ¶
CaptionConfig configures a <caption> element. No required fields.
type CheckboxConfig ¶
type CheckboxConfig struct {
Name string // required
Value string // optional
ID string // optional (but strongly recommended for label association)
Checked bool // optional
Class string
ExtraAttrs Attrs
}
CheckboxConfig configures a void <input type="checkbox"> element. Required: Name.
type DetailsConfig ¶
type DetailsConfig struct {
Class string
ID string
ExtraAttrs Attrs
// Disclosure marks this details element as a dismissible disclosure
// (mobile hamburger nav, popover, etc.). The runtime will close it
// automatically on SPA navigation and on Escape. See ARCHITECTURE.md
// data-fui-disclosure.
Disclosure bool
// Open opens the details element on initial render.
Open bool
}
DetailsConfig configures a <details> element. No required fields.
type DivConfig ¶
type DivConfig struct {
Class string
ID string
Role string
AriaLabel string
ExtraAttrs Attrs // passthrough for any extra attributes
}
DivConfig configures a <div> element. No required fields.
type FieldSetConfig ¶
type FieldSetConfig struct {
Legend string // required: becomes <legend> text
Class string
ID string
ExtraAttrs Attrs
}
FieldSetConfig configures a <fieldset> element. Required: Legend.
type FigCaptionConfig ¶
FigCaptionConfig configures a <figcaption> element. No required fields.
type FigureConfig ¶
FigureConfig configures a <figure> element. No required fields.
type FooterConfig ¶
type FooterConfig struct {
}
FooterConfig configures a <footer> element. Set ContentInfo=true to mark it as the page-wide footer (adds role="contentinfo"). Defaults to false because a page may have multiple <footer> elements (article footers, section footers) and only ONE should carry the contentinfo role.
type FormConfig ¶
type FormConfig struct {
Method string // required: "GET" or "POST"
Action string // optional: form action URL
Class string
ID string
ExtraAttrs Attrs
}
FormConfig configures a <form> element. Required: Method.
type GroupConfig ¶
type GroupConfig struct {
Role string // required
AriaLabel string
Class string
ID string
ExtraAttrs Attrs
}
GroupConfig configures a <div> with an ARIA role. Required: Role.
type HeaderConfig ¶
type HeaderConfig struct {
Class string
ID string
ExtraAttrs Attrs
Banner bool // explicit opt-in for role="banner"
}
HeaderConfig configures a <header> element. Set Banner=true to mark it as the page-wide banner (adds role="banner"). Defaults to false because a page may have multiple <header> elements (article headers, section headers, page-content headers) and only ONE should carry the banner role.
type HeadingConfig ¶
HeadingConfig configures an <h1>–<h6> element. Required: Level (1-6).
type ImageConfig ¶
type ImageConfig struct {
Src string // required
Alt string // required (empty = decorative image)
Class string
ID string
ExtraAttrs Attrs
}
ImageConfig configures a void <img> element. Required: Src and Alt (empty Alt = decorative, gets role="presentation").
type InputConfig ¶
type InputConfig struct {
Type string // required: "text", "email", "password", etc.
Name string // required: form field name
Value string // optional: initial value (typed equivalent of Attrs{"value": ...})
Placeholder string // optional: placeholder text
Class string
ID string
ExtraAttrs Attrs // escape hatch for attributes not covered by typed fields
}
InputConfig configures a void <input> element. Required: Type and Name.
type LabelConfig ¶
type LabelConfig struct {
For string // required: ID of the associated form control
Text string // required: label text
Class string
ID string
ExtraAttrs Attrs
}
LabelConfig configures a <label> element. Required: For (the ID of the form control) and Text.
type LinkConfig ¶
type LinkConfig struct {
Href string // required
Text string // required (visible text content)
Class string
ID string
ExtraAttrs Attrs
}
LinkConfig configures an <a> element. Required: Href and Text.
type LinkHTMLConfig ¶
type LinkHTMLConfig struct {
Href string // required
Content render.HTML // required (raw HTML content)
Class string
ID string
ExtraAttrs Attrs
}
LinkHTMLConfig configures an <a> element with raw HTML content. Required: Href and Content.
type ListConfig ¶
ListConfig configures a list element (<ul> or <ol>). No required fields.
type ListItemConfig ¶
ListItemConfig configures an <li> element. No required fields.
type MainConfig ¶
MainConfig configures a <main> element. Automatically adds role="main" and id="main-content".
type NavConfig ¶
type NavConfig struct {
}
NavConfig configures a <nav> element. Required: Label or LabelledBy (one must be set — becomes aria-label/aria-labelledby). Automatically adds role="navigation".
type RadioConfig ¶
type RadioConfig struct {
Name string // required
Value string // required
ID string // optional (but strongly recommended)
Checked bool // optional
Class string
ExtraAttrs Attrs
}
RadioConfig configures a void <input type="radio"> element. Required: Name and Value.
type SectionConfig ¶
type SectionConfig struct {
Label string // required → aria-label
LabelledBy string // alternative → aria-labelledby
Class string
ID string
ExtraAttrs Attrs
}
SectionConfig configures a <section> element. Required: Label or LabelledBy (one must be set — becomes aria-label/aria-labelledby).
type SelectConfig ¶
type SelectConfig struct {
Name string // required: form field name
Options []SelectOption // required: at least one option
Class string
ID string
ExtraAttrs Attrs
}
SelectConfig configures a <select> element. Required: Name and Options.
type SelectOption ¶
SelectOption represents a single <option> within a <select> element.
type SourceConfig ¶
type SourceConfig struct {
Src string // required
Type string // required: MIME type
Class string
ID string
ExtraAttrs Attrs
}
SourceConfig configures a void <source> element. Required: Src and Type.
type SummaryConfig ¶
SummaryConfig configures a <summary> element. No required fields.
type TableConfig ¶
TableConfig configures a <table> element. Automatically adds role="table".
type TableRowConfig ¶
TableRowConfig configures a <tr> element.
type TableSectionConfig ¶
TableSectionConfig configures thead/tbody/tfoot elements.
type TextAreaConfig ¶
type TextAreaConfig struct {
Name string // required: form field name
Content string // optional: initial text content (HTML-escaped on render)
Placeholder string // optional: placeholder text
Rows int // optional: rows attribute (>0 only)
Cols int // optional: cols attribute (>0 only)
Class string
ID string
ExtraAttrs Attrs // escape hatch for attributes not covered by typed fields
}
TextAreaConfig configures a <textarea> element. Required: Name.
type TextConfig ¶
TextConfig configures a text container element (Paragraph, Span, Strong, Em, etc.). No required fields — used for generic text containers.
type TimeConfig ¶
type TimeConfig struct {
Datetime string // required: machine-readable datetime
Class string
ID string
ExtraAttrs Attrs
}
TimeConfig configures a <time> element. Required: Datetime.
type VideoConfig ¶
VideoConfig configures a <video> element. No required fields.