shorthand

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package shorthand provides a mixed-argument companion surface for html.

The parent html package keeps the stable typed builders such as html.Div and html.Button. This package reuses the same option helpers and child normalization, but exposes host-tag functions that accept a single shared argument list of prop options and children:

return shorthand.Div(
	shorthand.ClassStr("panel"),
	shorthand.H2("Counter"),
	shorthand.Button(shorthand.OnClick(increment), "Increment"),
)

Strings and other text-like child values are normalized through html.Text, and option helpers keep the same last-write-wins semantics as html.PropsOf. The supported path for full-struct props is shorthand.FromProps(...), which preserves explicit zero values before later options are applied.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A

func A(parseArgs ...any) ui.Node

A delegates to html.A.

func Abbr

func Abbr(parseArgs ...any) ui.Node

Abbr delegates to html.Abbr.

func Article

func Article(parseArgs ...any) ui.Node

Article delegates to html.Article.

func Aside

func Aside(parseArgs ...any) ui.Node

Aside delegates to html.Aside.

func Audio

func Audio(parseArgs ...any) ui.Node

Audio delegates to html.Audio.

func B

func B(parseArgs ...any) ui.Node

B delegates to html.B.

func Blockquote

func Blockquote(parseArgs ...any) ui.Node

Blockquote delegates to html.Blockquote.

func Body

func Body(parseArgs ...any) ui.Node

Body delegates to html.Body.

func Br

func Br(parseArgs ...any) ui.Node

Br delegates to html.Br.

func Button

func Button(parseArgs ...any) ui.Node

Button delegates to html.Button.

func Canvas

func Canvas(parseArgs ...any) ui.Node

Canvas delegates to html.Canvas.

func Caption

func Caption(parseArgs ...any) ui.Node

Caption delegates to html.Caption.

func Children

func Children(parseValues ...any) []ui.Node

Children delegates to html.Children.

func Circle

func Circle(parseArgs ...any) ui.Node

Circle delegates to html.Circle.

func ClassMap

func ClassMap(parseValues map[string]bool) string

ClassMap delegates to html.ClassMap.

func ClassNames

func ClassNames(parseParts ...any) string

ClassNames delegates to html.ClassNames.

func ClipPath

func ClipPath(parseArgs ...any) ui.Node

ClipPath is the SVG <clipPath> element (G8).

func Coalesce

func Coalesce[T any](parseValues ...*T) *T

Coalesce delegates to html.Coalesce.

func Code

func Code(parseArgs ...any) ui.Node

Code delegates to html.Code.

func Col

func Col(parseArgs ...any) ui.Node

Col delegates to html.Col.

func Colgroup

func Colgroup(parseArgs ...any) ui.Node

Colgroup delegates to html.Colgroup.

func Cond

func Cond(parseBranches ...CondBranch) ui.Node

Cond delegates to html.Cond.

func Datalist

func Datalist(parseArgs ...any) ui.Node

Datalist delegates to html.Datalist.

func Debounce

func Debounce(parseDelay time.Duration, parseCallback any) any

Debounce delegates to html.Debounce.

func Defer

func Defer(shown bool, placeholder ui.Node, content func() ui.Node) ui.Node

Defer renders placeholder until shown is true, then builds and renders content. content is a thunk invoked ONLY when shown — so the deferred (often expensive) subtree is never constructed until it is actually needed. This is the rendering half of deferrable views (Angular `@defer` / React lazy): pair shown with a viewport/idle/interaction trigger latched via ui.UseDefer to keep heavy off-screen views out of the render path until they matter.

shorthand.Defer(ui.UseDefer(visible), Spinner(), func() ui.Node { return HeavyChart(data) })

func Defs

func Defs(parseArgs ...any) ui.Node

Defs delegates to html.Defs.

func Del

func Del(parseArgs ...any) ui.Node

Del delegates to html.Del.

func Details

func Details(parseArgs ...any) ui.Node

Details delegates to html.Details.

func Dialog

func Dialog(parseArgs ...any) ui.Node

Dialog delegates to html.Dialog.

func Div

func Div(parseArgs ...any) ui.Node

Div delegates to html.Div.

func Ellipse

func Ellipse(parseArgs ...any) ui.Node

Ellipse is the SVG <ellipse> element (G8).

func Em

func Em(parseArgs ...any) ui.Node

Em delegates to html.Em.

func Fieldset

func Fieldset(parseArgs ...any) ui.Node

Fieldset delegates to html.Fieldset.

func Figcaption

func Figcaption(parseArgs ...any) ui.Node

Figcaption delegates to html.Figcaption.

func Figure

func Figure(parseArgs ...any) ui.Node

Figure delegates to html.Figure.

func FilterMap

func FilterMap[T any](parseItems []T, render func(T) (ui.Node, bool)) []ui.Node

FilterMap delegates to html.FilterMap.

func FlatMap

func FlatMap[T any](parseItems []T, render func(T) []ui.Node) []ui.Node

FlatMap delegates to html.FlatMap.

func Footer(parseArgs ...any) ui.Node

Footer delegates to html.Footer.

func ForeignObject

func ForeignObject(parseArgs ...any) ui.Node

ForeignObject is the SVG <foreignObject> element (G8).

func Form

func Form(parseArgs ...any) ui.Node

Form delegates to html.Form.

func Fragment

func Fragment(parseArgs ...any) ui.Node

Fragment groups mixed children without introducing a host element.

func FromProps

func FromProps(parseProps Props) any

FromProps injects a full Props value into a mixed-argument shorthand call.

func G

func G(parseArgs ...any) ui.Node

G delegates to html.G.

func GradientStop

func GradientStop(parseArgs ...any) ui.Node

GradientStop is the SVG <stop> gradient color stop. Named GradientStop to avoid colliding with the Stop event-propagation helper (G8).

func H1

func H1(parseArgs ...any) ui.Node

H1 delegates to html.H1.

func H2

func H2(parseArgs ...any) ui.Node

H2 delegates to html.H2.

func H3

func H3(parseArgs ...any) ui.Node

H3 delegates to html.H3.

func H4

func H4(parseArgs ...any) ui.Node

H4 delegates to html.H4.

func H5

func H5(parseArgs ...any) ui.Node

H5 delegates to html.H5.

func H6

func H6(parseArgs ...any) ui.Node

H6 delegates to html.H6.

func Head(parseArgs ...any) ui.Node

Head delegates to html.Head.

func Header(parseArgs ...any) ui.Node

Header delegates to html.Header.

func HiddenInput

func HiddenInput(parseName string, parseValue string) ui.Node

HiddenInput creates a hidden input element with the given name and value, delegating to html.HiddenInput.

func Hr

func Hr(parseArgs ...any) ui.Node

Hr delegates to html.Hr.

func Html

func Html(parseArgs ...any) ui.Node

Html delegates to html.Html.

func I

func I(parseArgs ...any) ui.Node

I delegates to html.I.

func If

func If(isCondition bool, parseNode ui.Node) ui.Node

If delegates to html.If.

func IfElse

func IfElse(isCondition bool, parseWhenTrue ui.Node, parseWhenFalse ui.Node) ui.Node

IfElse delegates to html.IfElse.

func Iframe

func Iframe(parseArgs ...any) ui.Node

Iframe delegates to html.Iframe.

func Img

func Img(parseArgs ...any) ui.Node

Img delegates to html.Img.

func Index

func Index[T any](parseItems []T, render func(parseIndex int, parseItem T) ui.Node) []ui.Node

Index renders a list keyed by POSITION rather than value — Solid's `<Index>`. The node at each slot is reused as that position's value changes (instead of being torn down/rebuilt on reorder), which is the right choice for lists of primitives or inputs where identity follows position, not content. Contrast Map (value order) and MapKeyed (value identity).

func Input

func Input(parseArgs ...any) ui.Node

Input delegates to html.Input.

func Ins

func Ins(parseArgs ...any) ui.Node

Ins delegates to html.Ins.

func Join

func Join(parseSeparator ui.Node, parseNodes ...ui.Node) []ui.Node

Join delegates to html.Join.

func Kbd

func Kbd(parseArgs ...any) ui.Node

Kbd delegates to html.Kbd.

func Label

func Label(parseArgs ...any) ui.Node

Label delegates to html.Label.

func Legend

func Legend(parseArgs ...any) ui.Node

Legend delegates to html.Legend.

func Li

func Li(parseArgs ...any) ui.Node

Li delegates to html.Li.

func Line

func Line(parseArgs ...any) ui.Node

Line delegates to html.Line.

func LinearGradient

func LinearGradient(parseArgs ...any) ui.Node

LinearGradient is the SVG <linearGradient> element (G8).

func Main

func Main(parseArgs ...any) ui.Node

Main delegates to html.Main.

func Map

func Map[T any](parseItems []T, render func(T) ui.Node) []ui.Node

Map delegates to html.Map.

func MapIndexed

func MapIndexed[T any](parseItems []T, render func(parseIndex int, parseItem T) ui.Node) []ui.Node

MapIndexed delegates to html.MapIndexed.

func MapKeyed

func MapKeyed[T any](parseItems []T, parseKey func(T) any, render func(T) ui.Node) []ui.Node

MapKeyed delegates to html.MapKeyed.

func MapKeyedComponent

func MapKeyedComponent[T any](parseItems []T, parseKey func(T) any, render func(T) ui.Node) []ui.Node

MapKeyedComponent delegates to html.MapKeyedComponent: renders each item as its own keyed component so the render func may use hooks and On* handlers directly (G1).

func MapKeyedIndexed

func MapKeyedIndexed[T any](parseItems []T, parseKey func(parseIndex int, parseItem T) any, render func(parseIndex int, parseItem T) ui.Node) []ui.Node

MapKeyedIndexed delegates to html.MapKeyedIndexed.

func MapKeyedOr

func MapKeyedOr[T any](parseItems []T, parseKey func(T) any, render func(T) ui.Node, parseFallback ui.Node) ui.Node

MapKeyedOr delegates to html.MapKeyedOr.

func MapOr

func MapOr[T any](parseItems []T, render func(T) ui.Node, parseFallback ui.Node) ui.Node

MapOr delegates to html.MapOr.

func Mark

func Mark(parseArgs ...any) ui.Node

Mark delegates to html.Mark.

func Markdown

func Markdown(parseSource string, parseOptions ...MarkdownRenderOptions) []ui.Node

Markdown delegates to html.Markdown.

func Marker

func Marker(parseArgs ...any) ui.Node

Marker is the SVG <marker> element (G8).

func Mask

func Mask(parseArgs ...any) ui.Node

Mask is the SVG <mask> element (G8).

func Maybe

func Maybe[T any](parseValue *T, render func(T) ui.Node) ui.Node

Maybe delegates to html.Maybe.

func MaybeOr

func MaybeOr[T any](parseValue *T, render func(T) ui.Node, parseFallback ui.Node) ui.Node

MaybeOr delegates to html.MaybeOr.

func Meta

func Meta(parseArgs ...any) ui.Node

Meta delegates to html.Meta.

func Meter

func Meter(parseArgs ...any) ui.Node

Meter delegates to html.Meter.

func Nav(parseArgs ...any) ui.Node

Nav delegates to html.Nav.

func NoScript

func NoScript(parseArgs ...any) ui.Node

NoScript delegates to html.NoScript.

func Ol

func Ol(parseArgs ...any) ui.Node

Ol delegates to html.Ol.

func Optgroup

func Optgroup(parseArgs ...any) ui.Node

Optgroup delegates to html.Optgroup.

func Option

func Option(parseArgs ...any) ui.Node

Option delegates to html.Option.

func OrElse

func OrElse[T any](parseValue *T, parseFallback T) T

OrElse delegates to html.OrElse.

func Output

func Output(parseArgs ...any) ui.Node

Output delegates to html.Output.

func P

func P(parseArgs ...any) ui.Node

P delegates to html.P.

func Passive

func Passive(parseCallback any) any

Passive delegates to html.Passive.

func Path

func Path(parseArgs ...any) ui.Node

Path delegates to html.Path.

func Picture

func Picture(parseArgs ...any) ui.Node

Picture delegates to html.Picture.

func Polygon

func Polygon(parseArgs ...any) ui.Node

Polygon delegates to html.Polygon.

func Polyline

func Polyline(parseArgs ...any) ui.Node

Polyline delegates to html.Polyline.

func Pre

func Pre(parseArgs ...any) ui.Node

Pre delegates to html.Pre.

func Prevent

func Prevent(parseCallback any) any

Prevent delegates to html.Prevent.

func Progress

func Progress(parseArgs ...any) ui.Node

Progress delegates to html.Progress.

func RadialGradient

func RadialGradient(parseArgs ...any) ui.Node

RadialGradient is the SVG <radialGradient> element (G8).

func Range

func Range(parseCount int, render func(parseIndex int) ui.Node) []ui.Node

Range delegates to html.Range.

func RawHTML

func RawHTML(parseMarkup string) []ui.Node

RawHTML parses sanitized markup into nodes (safe for untrusted input). Delegates to html.RawHTML.

func RawHTMLUnsafe

func RawHTMLUnsafe(parseMarkup string) []ui.Node

RawHTMLUnsafe parses trusted markup without sanitization (still a real node tree, never innerHTML). Delegates to html.RawHTMLUnsafe.

func RawHTMLWith

func RawHTMLWith(parseMarkup string, parsePolicy sanitize.Policy) []ui.Node

RawHTMLWith parses markup under a caller-provided sanitize policy.

func Rect

func Rect(parseArgs ...any) ui.Node

Rect delegates to html.Rect.

func Repeat

func Repeat(parseCount int, parseNode ui.Node) []ui.Node

Repeat delegates to html.Repeat.

func Script

func Script(parseArgs ...any) ui.Node

Script delegates to html.Script.

func Section

func Section(parseArgs ...any) ui.Node

Section delegates to html.Section.

func Select

func Select(parseArgs ...any) ui.Node

Select delegates to html.Select.

func Show

func Show(isCondition bool, parseNode ui.Node) ui.Node

Show delegates to html.Show.

func Small

func Small(parseArgs ...any) ui.Node

Small delegates to html.Small.

func Source

func Source(parseArgs ...any) ui.Node

Source delegates to html.Source.

func Span

func Span(parseArgs ...any) ui.Node

Span delegates to html.Span.

func Stop

func Stop(parseCallback any) any

Stop delegates to html.Stop.

func Strong

func Strong(parseArgs ...any) ui.Node

Strong delegates to html.Strong.

func Sub

func Sub(parseArgs ...any) ui.Node

Sub delegates to html.Sub.

func Summary

func Summary(parseArgs ...any) ui.Node

Summary delegates to html.Summary.

func Sup

func Sup(parseArgs ...any) ui.Node

Sup delegates to html.Sup.

func Svg

func Svg(parseArgs ...any) ui.Node

Svg delegates to html.Svg.

func SvgImage

func SvgImage(parseArgs ...any) ui.Node

SvgImage is the SVG <image> element (named SvgImage to avoid colliding with a potential HTML image helper) (G8).

func SvgPattern

func SvgPattern(parseArgs ...any) ui.Node

SvgPattern is the SVG <pattern> element (named SvgPattern to avoid colliding with the Pattern helper) (G8).

func Switch

func Switch(parseValue any, parseBranches ...SwitchBranch) ui.Node

Switch delegates to html.Switch.

func Symbol

func Symbol(parseArgs ...any) ui.Node

Symbol is the SVG <symbol> element (G8).

func TSpan

func TSpan(parseArgs ...any) ui.Node

TSpan is the SVG <tspan> element for positioned text runs (G8).

func Table

func Table(parseArgs ...any) ui.Node

Table delegates to html.Table.

func Tag

func Tag(parseName string, parseArgs ...any) ui.Node

Tag builds an arbitrary host element from mixed prop options and children.

func Tbody

func Tbody(parseArgs ...any) ui.Node

Tbody delegates to html.Tbody.

func Td

func Td(parseArgs ...any) ui.Node

Td delegates to html.Td.

func Text

func Text(parseContent any) ui.Node

Text delegates to html.Text.

func TextIf

func TextIf(isCondition bool, parseContent any) ui.Node

TextIf delegates to html.TextIf.

func TextLines

func TextLines(parseText string) []ui.Node

TextLines delegates to html.TextLines.

func Textarea

func Textarea(parseArgs ...any) ui.Node

Textarea delegates to html.Textarea.

func Textf

func Textf(format string, parseArgs ...any) ui.Node

Textf delegates to html.Textf.

func Tfoot

func Tfoot(parseArgs ...any) ui.Node

Tfoot delegates to html.Tfoot.

func Th

func Th(parseArgs ...any) ui.Node

Th delegates to html.Th.

func Thead

func Thead(parseArgs ...any) ui.Node

Thead delegates to html.Thead.

func Throttle

func Throttle(parseInterval time.Duration, parseCallback any) any

Throttle delegates to html.Throttle.

func Time

func Time(parseArgs ...any) ui.Node

Time delegates to html.Time.

func Tr

func Tr(parseArgs ...any) ui.Node

Tr delegates to html.Tr.

func Track

func Track(parseArgs ...any) ui.Node

Track delegates to html.Track.

func U

func U(parseArgs ...any) ui.Node

U delegates to html.U.

func Ul

func Ul(parseArgs ...any) ui.Node

Ul delegates to html.Ul.

func Unless

func Unless(isCondition bool, parseNode ui.Node) ui.Node

Unless delegates to html.Unless.

func Use

func Use(parseArgs ...any) ui.Node

Use delegates to html.Use.

func Video

func Video(parseArgs ...any) ui.Node

Video delegates to html.Video.

func When

func When(isCondition bool, parseClassName string) string

When delegates to html.When.

func WithChildren

func WithChildren(parseNode ui.Node, parseChildren ...ui.Node) ui.Node

WithChildren delegates to html.WithChildren.

func WithKey

func WithKey(parseNode ui.Node, parseKey any) ui.Node

WithKey delegates to html.WithKey.

Types

type CondBranch

type CondBranch = html.CondBranch

CondBranch aliases html.CondBranch.

func Match

func Match(isCondition bool, parseNode ui.Node) CondBranch

Match delegates to html.Match.

func Otherwise

func Otherwise(parseNode ui.Node) CondBranch

Otherwise delegates to html.Otherwise.

type MarkdownRenderOptions

type MarkdownRenderOptions = html.MarkdownRenderOptions

MarkdownRenderOptions aliases html.MarkdownRenderOptions.

type NamedSlot

type NamedSlot struct {
	Name     string
	Children []ui.Node
}

NamedSlot is a group of children tagged with a slot name, produced by Slot and collected into a Slots set.

func Slot

func Slot(parseName string, parseChildren ...ui.Node) NamedSlot

Slot tags children with a slot name for placement into a Slots set.

card(NewSlots(
    Slot("header", html.Text("Title")),
    Slot("body", content...),
))

type PropOption

type PropOption = html.PropOption

func Accept

func Accept(parseValue string) PropOption

Accept delegates to html.Accept.

func Alt

func Alt(parseValue string) PropOption

Alt delegates to html.Alt.

func Aria

func Aria(parseName string, parseValue string) PropOption

Aria delegates to html.Aria.

func AriaSet

func AriaSet(parseValues map[string]string) PropOption

AriaSet delegates to html.AriaSet.

func Attr

func Attr(parseKey string, parseValue any) PropOption

Attr delegates to html.Attr.

func AttrIf

func AttrIf(isCondition bool, parseKey string, parseValue any) PropOption

AttrIf delegates to html.AttrIf.

func Attrs

func Attrs(parseValues map[string]any) PropOption

Attrs delegates to html.Attrs.

func AutoComplete

func AutoComplete(parseValue string) PropOption

AutoComplete delegates to html.AutoComplete.

func AutoFocus

func AutoFocus(parseValues ...bool) PropOption

AutoFocus delegates to html.AutoFocus.

func Bind

func Bind(parseState ui.State[string]) PropOption

Bind delegates to html.Bind: two-way binds a controlled input to a ui.State[string] in one call (value + oninput).

func BindFunc

func BindFunc(parseGet func() string, parseSet func(string)) PropOption

BindFunc delegates to html.BindFunc: two-way binds an input through an explicit getter and setter, for sources that are not a single handle.

func BindTo

func BindTo(parseTarget html.Binding) PropOption

BindTo delegates to html.BindTo: two-way binds a controlled input to any Get()/Set() string handle — including a state.Signal[string] or atom handle.

func Checked

func Checked(parseValues ...bool) PropOption

Checked delegates to html.Checked.

func ClassIf

func ClassIf(isCondition bool, parseClass string) PropOption

ClassIf delegates to html.ClassIf.

func ClassStr

func ClassStr(parseValue string) PropOption

Class delegates to html.Class.

func ColSpan

func ColSpan(parseValue int) PropOption

ColSpan delegates to html.ColSpan.

func Cols

func Cols(parseValue int) PropOption

Cols delegates to html.Cols.

func Data

func Data(parseName string, parseValue string) PropOption

Data delegates to html.Data.

func Dataset

func Dataset(parseValues map[string]string) PropOption

Dataset delegates to html.Dataset.

func Dir

func Dir(parseValue string) PropOption

Dir delegates to html.Dir.

func Disabled

func Disabled(parseValues ...bool) PropOption

Disabled delegates to html.Disabled.

func DisabledIf

func DisabledIf(isCondition bool) PropOption

DisabledIf delegates to html.DisabledIf.

func For

func For(parseValue string) PropOption

For delegates to html.For.

func Height

func Height(parseValue string) PropOption

Height delegates to html.Height.

func Hidden

func Hidden(parseValues ...bool) PropOption

Hidden delegates to html.Hidden.

func Href

func Href(parseValue string) PropOption

Href delegates to html.Href.

func ID

func ID(parseValue string) PropOption

ID delegates to html.ID.

func Lang

func Lang(parseValue string) PropOption

Lang delegates to html.Lang.

func Loading

func Loading(parseValue string) PropOption

Loading delegates to html.Loading.

func Max

func Max(parseValue string) PropOption

Max delegates to html.Max.

func MaxLength

func MaxLength(parseValue int) PropOption

MaxLength delegates to html.MaxLength.

func Min

func Min(parseValue string) PropOption

Min delegates to html.Min.

func MinLength

func MinLength(parseValue int) PropOption

MinLength delegates to html.MinLength.

func Multiple

func Multiple(parseValues ...bool) PropOption

Multiple delegates to html.Multiple.

func Name

func Name(parseValue string) PropOption

Name delegates to html.Name.

func OnAnimationEnd

func OnAnimationEnd(parseCallback any) PropOption

OnAnimationEnd delegates to html.OnAnimationEnd.

func OnBlur

func OnBlur(parseCallback any) PropOption

OnBlur delegates to html.OnBlur.

func OnChange

func OnChange(parseCallback any) PropOption

OnChange delegates to html.OnChange.

func OnClick

func OnClick(parseCallback any) PropOption

OnClick delegates to html.OnClick.

func OnClickParallel

func OnClickParallel(parseSlotID string, parseCallback any) PropOption

OnClickParallel delegates to html.OnClickParallel.

func OnContextMenu

func OnContextMenu(parseCallback any) PropOption

OnContextMenu delegates to html.OnContextMenu.

func OnDoubleClick

func OnDoubleClick(parseCallback any) PropOption

OnDoubleClick delegates to html.OnDoubleClick.

func OnDragEnd

func OnDragEnd(parseCallback any) PropOption

OnDragEnd delegates to html.OnDragEnd.

func OnDragOver

func OnDragOver(parseCallback any) PropOption

OnDragOver delegates to html.OnDragOver.

func OnDragStart

func OnDragStart(parseCallback any) PropOption

OnDragStart delegates to html.OnDragStart.

func OnDrop

func OnDrop(parseCallback any) PropOption

OnDrop delegates to html.OnDrop.

func OnError

func OnError(parseCallback any) PropOption

OnError delegates to html.OnError.

func OnFocus

func OnFocus(parseCallback any) PropOption

OnFocus delegates to html.OnFocus.

func OnInput

func OnInput(parseCallback any) PropOption

OnInput delegates to html.OnInput.

func OnKeyDown

func OnKeyDown(parseCallback any) PropOption

OnKeyDown delegates to html.OnKeyDown.

func OnKeyUp

func OnKeyUp(parseCallback any) PropOption

OnKeyUp delegates to html.OnKeyUp.

func OnLoad

func OnLoad(parseCallback any) PropOption

OnLoad delegates to html.OnLoad.

func OnMouseDown

func OnMouseDown(parseCallback any) PropOption

func OnMouseEnter

func OnMouseEnter(parseCallback any) PropOption

OnMouseEnter delegates to html.OnMouseEnter.

func OnMouseLeave

func OnMouseLeave(parseCallback any) PropOption

OnMouseLeave delegates to html.OnMouseLeave.

func OnMouseUp

func OnMouseUp(parseCallback any) PropOption

OnMouseUp delegates to html.OnMouseUp.

func OnPointerDown

func OnPointerDown(parseCallback any) PropOption

OnPointerDown delegates to html.OnPointerDown.

func OnPointerMove

func OnPointerMove(parseCallback any) PropOption

OnPointerMove delegates to html.OnPointerMove.

func OnPointerUp

func OnPointerUp(parseCallback any) PropOption

OnPointerUp delegates to html.OnPointerUp.

func OnScroll

func OnScroll(parseCallback any) PropOption

OnScroll delegates to html.OnScroll.

func OnSubmit

func OnSubmit(parseCallback any) PropOption

OnSubmit delegates to html.OnSubmit.

func OnTouchEnd

func OnTouchEnd(parseCallback any) PropOption

OnTouchEnd delegates to html.OnTouchEnd.

func OnTouchMove

func OnTouchMove(parseCallback any) PropOption

OnTouchMove delegates to html.OnTouchMove.

func OnTouchStart

func OnTouchStart(parseCallback any) PropOption

OnTouchStart delegates to html.OnTouchStart.

func OnTransitionEnd

func OnTransitionEnd(parseCallback any) PropOption

OnTransitionEnd delegates to html.OnTransitionEnd.

func OnWheel

func OnWheel(parseCallback any) PropOption

OnWheel delegates to html.OnWheel.

func Open

func Open(parseValues ...bool) PropOption

Open delegates to html.Open.

func Pattern

func Pattern(parseValue string) PropOption

Pattern delegates to html.Pattern.

func Placeholder

func Placeholder(parseValue string) PropOption

Placeholder delegates to html.Placeholder.

func ReadOnly

func ReadOnly(parseValues ...bool) PropOption

ReadOnly delegates to html.ReadOnly.

func ReadOnlyIf

func ReadOnlyIf(isCondition bool) PropOption

ReadOnlyIf delegates to html.ReadOnlyIf.

func Ref

func Ref(parseRef ui.DOMRef) PropOption

Ref binds a ui.DOMRef to an element so its live DOM node is published into the ref on mount. Delegates to html.Ref.

func Rel

func Rel(parseValue string) PropOption

Rel delegates to html.Rel.

func Required

func Required(parseValues ...bool) PropOption

Required delegates to html.Required.

func Role

func Role(parseValue string) PropOption

Role delegates to html.Role.

func RowSpan

func RowSpan(parseValue int) PropOption

RowSpan delegates to html.RowSpan.

func Rows

func Rows(parseValue int) PropOption

Rows delegates to html.Rows.

func Selected

func Selected(parseValues ...bool) PropOption

Selected delegates to html.Selected.

func SelectedIf

func SelectedIf(isCondition bool) PropOption

SelectedIf delegates to html.SelectedIf.

func Src

func Src(parseValue string) PropOption

Src delegates to html.Src.

func Step

func Step(parseValue string) PropOption

Step delegates to html.Step.

func Style

func Style(parseValues map[string]string) PropOption

Style delegates to html.Style.

func StyleIf

func StyleIf(isCondition bool, parseValues map[string]string) PropOption

StyleIf delegates to html.StyleIf.

func StyleVar

func StyleVar(parseName string, parseValue string) PropOption

StyleVar delegates to html.StyleVar.

func TabIndex

func TabIndex(parseValue int) PropOption

TabIndex delegates to html.TabIndex.

func Target

func Target(parseValue string) PropOption

Target delegates to html.Target.

func Title

func Title(parseValue string) PropOption

Title delegates to html.Title.

func Type

func Type(parseValue string) PropOption

Type delegates to html.Type.

func Value

func Value(parseValue string) PropOption

Value delegates to html.Value.

func Width

func Width(parseValue string) PropOption

Width delegates to html.Width.

type Props

type Props = html.Props

func DefaultProps

func DefaultProps(parseProps Props, parseDefaults Props) Props

DefaultProps delegates to html.DefaultProps.

func MergeProps

func MergeProps(parseBase Props, parseOverride Props) Props

MergeProps delegates to html.MergeProps.

func PropsOf

func PropsOf(parseOptions ...PropOption) Props

PropsOf delegates to html.PropsOf.

func WithProps

func WithProps(parseBase Props, parseOptions ...PropOption) Props

WithProps delegates to html.WithProps.

type Slots

type Slots map[string][]ui.Node

Slots is a named collection of child node groups a component renders into labeled regions — explicit, typed named slots (Vue's named slots / React render-children-by-name) without magic. A component takes a Slots in its props and places each region with Render/Or.

func NewSlots

func NewSlots(parseSlots ...NamedSlot) Slots

NewSlots collects named slots into a Slots set. A later entry with the same name replaces an earlier one, so callers get last-wins override semantics.

func (Slots) Has

func (parseS Slots) Has(parseName string) bool

Has reports whether a non-empty slot was provided under name.

func (Slots) Or

func (parseS Slots) Or(parseName string, parseFallback ...ui.Node) []ui.Node

Or returns the named slot's children, or the fallback when the slot was not provided — the default-content pattern (a component supplies a sensible default a parent can override).

func (Slots) Render

func (parseS Slots) Render(parseName string) []ui.Node

Render returns the children for a named slot (nil when the slot is absent or empty) — what a component calls to place a slot in its layout.

type SwitchBranch

type SwitchBranch = html.SwitchBranch

func Case

func Case(parseValue any, parseNode ui.Node) SwitchBranch

Case delegates to html.Case.

func Default

func Default(parseNode ui.Node) SwitchBranch

Default delegates to html.Default.

Jump to

Keyboard shortcuts

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