Versions in this module Expand all Collapse all v0 v0.5.0 Jul 17, 2026 v0.4.0 Jul 17, 2026 Changes in this version + const FailedSanitizationURL + var NopComponent = ComponentFunc(func(ctx context.Context, w io.Writer) error { ... }) + func Bool(value bool) bool + func CSSID(name string, css string) string + func ClearChildren(ctx context.Context) context.Context + func EscapeString[T ~string](s T) string + func GetBuffer() *bytes.Buffer + func GetNonce(ctx context.Context) (nonce string) + func InitializeContext(ctx context.Context) context.Context + func JSONString(v any) (string, error) + func JoinStringErrs[T stringable](s T, errs ...error) (string, error) + func ReleaseBuffer(b *bytes.Buffer) + func RenderAttributes(ctx context.Context, w io.Writer, attributes Attributer) (err error) + func RenderCSSItems(ctx context.Context, w io.Writer, classes ...any) (err error) + func RenderFragments(ctx context.Context, w io.Writer, c Component, ids ...any) error + func RenderScriptItems(ctx context.Context, w io.Writer, scripts ...ComponentScript) (err error) + func ResolveAttributeValue[T attributeValue](v T, errs ...error) (string, error) + func SafeScript(functionName string, params ...any) string + func SafeScriptInline(functionName string, params ...any) string + func ToGoHTML(ctx context.Context, c Component) (s template.HTML, err error) + func Version() string + func WithChildren(ctx context.Context, children Component) context.Context + func WithContentType(contentType string) func(*ComponentHandler) + func WithErrorHandler(eh func(r *http.Request, err error) http.Handler) func(*ComponentHandler) + func WithFragments(ids ...any) func(*ComponentHandler) + func WithNonce(ctx context.Context, nonce string) context.Context + func WithStatus(status int) func(*ComponentHandler) + func WithStreaming() func(*ComponentHandler) + func WriteWatchModeString(w io.Writer, lineNum int) error + type Attributer interface + Items func() []KeyValue[string, any] + type Attributes map[string]any + func (a Attributes) Items() []KeyValue[string, any] + type CSSClass interface + ClassName func() string + func Class(name string) CSSClass + func SafeClass(name string) CSSClass + type CSSClasses []any + func Classes(classes ...any) CSSClasses + func (classes CSSClasses) String() string + type CSSHandler struct + Classes []ComponentCSSClass + Logger func(err error) + func NewCSSHandler(classes ...CSSClass) CSSHandler + func (cssh CSSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type CSSMiddleware struct + CSSHandler CSSHandler + Next http.Handler + Path string + func NewCSSMiddleware(next http.Handler, classes ...CSSClass) CSSMiddleware + func (cssm CSSMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request) + type Component interface + Render func(ctx context.Context, w io.Writer) error + func Fragment(id any) Component + func FromGoHTML(t *template.Template, data any) Component + func GetChildren(ctx context.Context) Component + func Join(components ...Component) Component + func Raw[T ~string](html T, errs ...error) Component + type ComponentCSSClass struct + Class SafeCSS + ID string + func (css ComponentCSSClass) ClassName() string + type ComponentFunc func(ctx context.Context, w io.Writer) error + func (cf ComponentFunc) Render(ctx context.Context, w io.Writer) error + type ComponentHandler struct + Component Component + ContentType string + ErrorHandler func(r *http.Request, err error) http.Handler + FragmentIDs []any + Status int + StreamResponse bool + func Handler(c Component, options ...func(*ComponentHandler)) *ComponentHandler + func (ch *ComponentHandler) ServeHTTPBuffered(w http.ResponseWriter, r *http.Request) + func (ch *ComponentHandler) ServeHTTPBufferedComplete(w http.ResponseWriter, r *http.Request) + func (ch *ComponentHandler) ServeHTTPBufferedFragment(w http.ResponseWriter, r *http.Request) + func (ch *ComponentHandler) ServeHTTPStreamed(w http.ResponseWriter, r *http.Request) + func (ch ComponentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type ComponentScript struct + Call string + CallInline string + Function string + Name string + func JSFuncCall[T ~string](functionName T, args ...any) ComponentScript + func JSUnsafeFuncCall[T ~string](js T) ComponentScript + func (c ComponentScript) Render(ctx context.Context, w io.Writer) error + type ConstantCSSClass string + func (css ConstantCSSClass) ClassName() string + type Error struct + Col int + Err error + FileName string + Line int + func (e Error) Error() string + func (e Error) Unwrap() error + type FlushComponent struct + func Flush() FlushComponent + func (f FlushComponent) Render(ctx context.Context, w io.Writer) (err error) + type FragmentContext struct + Active bool + IDs []any + W io.Writer + type JSExpression string + type JSONScriptElement struct + Data any + ID string + Nonce func(ctx context.Context) string + Type string + func JSONScript(id string, data any) JSONScriptElement + func (j JSONScriptElement) Render(ctx context.Context, w io.Writer) (err error) + func (j JSONScriptElement) WithNonceFrom(f func(context.Context) string) JSONScriptElement + func (j JSONScriptElement) WithNonceFromString(nonce string) JSONScriptElement + func (j JSONScriptElement) WithType(t string) JSONScriptElement + type KeyValue struct + Key TKey + Value TValue + func KV[TKey comparable, TValue any](key TKey, value TValue) KeyValue[TKey, TValue] + type OnceHandle struct + func NewOnceHandle(opts ...OnceOpt) *OnceHandle + func (o *OnceHandle) Once() Component + type OnceOpt func(*OnceHandle) + func WithComponent(c Component) OnceOpt + type OrderedAttributes []KeyValue[string, any] + func (a OrderedAttributes) Items() []KeyValue[string, any] + type SafeCSS string + func SanitizeCSS[T ~string](property string, value T) SafeCSS + type SafeCSSProperty string + type SafeURL string + func JoinURLErrs[T ~string](s T, errs ...error) (SafeURL, error) + func URL(s string) SafeURL