component

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	Text     string
	OnClick  func()
	Class    string
	Disabled bool
}

func NewButton

func NewButton(text string, onClick func()) *Button

func (*Button) Render

func (b *Button) Render() *vdom.VNode

func (*Button) SetClass

func (b *Button) SetClass(class string) *Button

func (*Button) SetDisabled

func (b *Button) SetDisabled(disabled bool) *Button

type Container

type Container struct {
	Children []vdom.Component
	Class    string
	ID       string
	Style    string
}

func NewContainer

func NewContainer() *Container

func (*Container) AddChild

func (c *Container) AddChild(child vdom.Component) *Container

func (*Container) Render

func (c *Container) Render() *vdom.VNode

func (*Container) SetClass

func (c *Container) SetClass(class string) *Container

func (*Container) SetID

func (c *Container) SetID(id string) *Container

func (*Container) SetStyle

func (c *Container) SetStyle(style string) *Container

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter(renderer *renderer.Renderer) *Counter

func (*Counter) Render

func (c *Counter) Render() *vdom.VNode

type Input

type Input struct {
	Value       string
	Placeholder string
	Type        string
	OnChange    func(string)
	OnInput     func(string)
	Class       string
}

func NewInput

func NewInput(placeholder string) *Input

func (*Input) OnChangeHandler

func (i *Input) OnChangeHandler(handler func(string)) *Input

func (*Input) OnInputHandler

func (i *Input) OnInputHandler(handler func(string)) *Input

func (*Input) Render

func (i *Input) Render() *vdom.VNode

func (*Input) SetClass

func (i *Input) SetClass(class string) *Input

func (*Input) SetType

func (i *Input) SetType(inputType string) *Input

func (*Input) SetValue

func (i *Input) SetValue(value string) *Input

type List

type List struct {
	Items       []string
	Ordered     bool
	Class       string
	OnItemClick func(int, string)
}

func NewList

func NewList(items []string) *List

func NewOrderedList

func NewOrderedList(items []string) *List

func (*List) OnItemClickHandler

func (l *List) OnItemClickHandler(handler func(int, string)) *List

func (*List) Render

func (l *List) Render() *vdom.VNode

func (*List) SetClass

func (l *List) SetClass(class string) *List

type Text

type Text struct {
	Content string
	Tag     string
	Class   string
}

func NewHeading

func NewHeading(content string, level int) *Text

func NewParagraph

func NewParagraph(content string) *Text

func NewText

func NewText(content string) *Text

func (*Text) Render

func (t *Text) Render() *vdom.VNode

func (*Text) SetClass

func (t *Text) SetClass(class string) *Text

Jump to

Keyboard shortcuts

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