gomps

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 18 Imported by: 0

README

gomps

Light wrapper around gomponents with some extra features and helpers.

wisshes mascot

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	A           = h.A
	ATTR        = g.Attr
	DIV         = h.Div
	BUTTON      = h.Button
	SPAN        = h.Span
	CLS         = h.Class
	META        = h.Meta
	NAME        = h.Name
	CONTENT     = h.Content
	LINK        = h.Link
	REL         = h.Rel
	CHARSET     = h.Charset
	TITLE       = h.TitleEl
	HEAD        = h.Head
	HTML        = h.HTML
	HTML5       = c.HTML5
	DOCTYPE     = h.Doctype
	BODY        = h.Body
	LANG        = h.Lang
	HR          = h.Hr
	HREF        = h.Href
	IMG         = h.Img
	SRC         = h.Src
	SCRIPT      = h.Script
	LABEL       = h.Label
	PLACEHOLDER = h.Placeholder
	TEXTAREA    = h.Textarea
	SELECT      = h.Select
	OPTION      = h.Option
	TABLE       = h.Table
	CAPTION     = h.Caption
	THEAD       = h.THead
	TBODY       = h.TBody
	TR          = h.Tr
	TH          = h.Th
	TD          = h.Td
	STYLE       = h.StyleAttr
	DIALOG      = h.Dialog

	REQUIRED = h.Required()
	DISABLED = h.Disabled()
	SELECTED = h.Selected()
	CHECKED  = g.Attr("checked")
	DEFER    = h.Defer()
	RAW      = g.Raw

	H1 = h.H1
	H2 = h.H2
	H3 = h.H3
	H4 = h.H4
	H5 = h.H5
	H6 = h.H6
	P  = h.P

	PRE  = h.Pre
	CODE = h.Code

	UL = h.Ul
	LI = h.Li

	ID  = h.ID
	ALT = h.Alt

	DETAILS = h.Details
	OPEN    = ATTR("open")
	SUMMARY = h.Summary

	FORM   = h.FormEl
	INPUT  = h.Input
	FOR    = h.For
	TYPE   = h.Type
	VALUE  = h.Value
	ACTION = h.Action
	METHOD = h.Method
	MIN    = h.Min
	MAX    = h.Max

	CANVAS = h.Canvas
)
View Source
var (
	HighlightDefaultStyle = "gruvbox"
)
View Source
var INTEGERTYPE = GRP(
	TYPE("number"),
	STEP(1),
)
View Source
var SVG = h.SVG

Functions

func EMPTY

func EMPTY[T any](arr []T) bool

func Render

func Render(w http.ResponseWriter, node NODE)

func ServerSentNode added in v0.0.22

func ServerSentNode(sse *toolbelt.ServerSentEventsHandler, n NODE) error

Types

type CLSS

type CLSS = c.Classes

type HTML5Props added in v0.0.5

type HTML5Props = c.HTML5Props

type Highlight added in v0.0.8

type Highlight struct {
	Language string
	Code     string
	Style    string
	Children NODES
}

func (Highlight) Render added in v0.0.8

func (h Highlight) Render(w io.Writer) error

type NODE

type NODE = g.Node

func ATTR_RAW added in v0.0.19

func ATTR_RAW(name string, value ...string) NODE

func CENTERSVGTEXT

func CENTERSVGTEXT(children ...NODE) NODE

func CIRCLE

func CIRCLE(children ...NODE) NODE

func CLSF

func CLSF(format string, args ...interface{}) NODE

func COLSPAN

func COLSPAN(colspan int) NODE

func CX

func CX(v float64) NODE

func CY

func CY(v float64) NODE

func DATA added in v0.0.7

func DATA(name string, value ...string) NODE

func DATAF added in v0.0.7

func DATAF(name, format string, args ...interface{}) NODE

func DOMINANTBASELINE

func DOMINANTBASELINE(v string) NODE

func ERR

func ERR(errs ...error) NODE

func FILL

func FILL(v string) NODE

func GRP

func GRP(children ...NODE) NODE

func HEIGHT

func HEIGHT(v float64) NODE

func HIGHLIGHT added in v0.0.8

func HIGHLIGHT(language, code string, children ...NODE) NODE

func ICON

func ICON(name string, children ...NODE) NODE

func IDF added in v0.1.0

func IDF(format string, args ...interface{}) NODE

func IDVT

func IDVT(id string) NODE

func IF

func IF(cond bool, ifTrue NodeCb) NODE

func IFCachedNode

func IFCachedNode(cond bool, ifTrue NODE) NODE

func LINE

func LINE(children ...NODE) NODE

func MAXI

func MAXI(max int) NODE

func MAXLEN

func MAXLEN(max int) NODE

func MINI

func MINI(min int) NODE

func MINLEN

func MINLEN(min int) NODE

func MiniAvatar added in v0.0.21

func MiniAvatar(seed string, saturation, lightness uint8, colorCount, gridSize int, children ...NODE) NODE

func MiniAvatarDefault added in v0.0.21

func MiniAvatarDefault(seed string, children ...NODE) NODE

func PREJSON

func PREJSON[T any](v T) NODE

func PREPBJSON

func PREPBJSON(m protoreflect.ProtoMessage) NODE

func R

func R(v float64) NODE

func RANGE

func RANGE[T any](ts []T, cb func(item T) NODE) NODE

func RANGEI

func RANGEI[T any](ts []T, cb func(i int, item T) NODE) NODE

func RECT added in v0.0.18

func RECT(children ...NODE) NODE

func ROWS

func ROWS(rows int) NODE

func SAFE

func SAFE(text string) NODE

func STEP

func STEP(step int) NODE

func STROKE

func STROKE(v string) NODE

func STROKEWIDTH

func STROKEWIDTH(v float64) NODE

func STYLEF added in v0.0.8

func STYLEF(format string, args ...interface{}) NODE

func TERN

func TERN(cond bool, ifTrue, ifFalse NodeCb) NODE

func TERNCached

func TERNCached(cond bool, ifTrue, ifFalse NODE) NODE

func TEXT

func TEXT(children ...NODE) NODE

func TEXTANCHOR

func TEXTANCHOR(v string) NODE

func TXT

func TXT(text string) NODE

func TXTF

func TXTF(format string, args ...interface{}) NODE

func TXTI

func TXTI[T uint | uint8 | uint16 | uint32 | uint64 | int | int8 | int16 | int32 | int64](v T) NODE

func VALUEI

func VALUEI[T uint | uint8 | uint16 | uint32 | uint64 | int | int8 | int16 | int32 | int64](v T) NODE

func VIEWBOX

func VIEWBOX(x, y, w, h int) NODE

func VIEWBOXF

func VIEWBOXF(x, y, w, h float64) NODE

func ViewTransitionName

func ViewTransitionName(id string) NODE

func WIDTH

func WIDTH(v float64) NODE

func X

func X(v float64) NODE

func X1

func X1(v float64) NODE

func X2

func X2(v float64) NODE

func Y

func Y(v float64) NODE

func Y1

func Y1(v float64) NODE

func Y2

func Y2(v float64) NODE

type NODES

type NODES = []g.Node

type NodeCb added in v0.0.22

type NodeCb func() NODE

type NodeFunc added in v0.0.23

type NodeFunc func(...NODE) NODE

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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