components

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 0 Imported by: 0

README

components

Project Badges

HTML components for the go web framework tinywasm

Architecture: SSR/WASM Separation

To avoid bloating the WebAssembly binary with styles and server-side logic, components should be split into shared and backend-only files:

  • component.go: Shared struct definition, HandlerName(), and RenderHTML().
  • ssr.go (or back.go): Backend-only methods like RenderCSS() and RenderJS(). Must include //go:build !wasm.
  • front.go: WASM-only methods like OnMount() and OnUnmount(). Must include //go:build wasm.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSSRenderer added in v0.0.2

type CSSRenderer interface {
	RenderCSS() string
}

CSSRenderer provides component-specific CSS

type Components

type Components struct{}

func New

func New() *Components

type DisplayNamer added in v0.0.2

type DisplayNamer interface {
	DisplayName() string
}

DisplayNamer provides a human-readable name for navigation

type HTMLRenderer added in v0.0.2

type HTMLRenderer interface {
	RenderHTML() string
}

HTMLRenderer renders the component's HTML structure

type IconProvider added in v0.0.2

type IconProvider interface {
	IconSvg() []map[string]string
}

IconProvider provides SVG icons for the global sprite

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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