WASM reactive UI framework for Go: - reactive/ - Signal[T], Effect, Runtime - ui/ - Button, Text, Input, View, Canvas, SVG components - navigation/ - Router, guards, history management - auth/ - OIDC client for WASM applications - host/ - Static file server Extracted from arcadia as open-source component. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
29
ui/view.go
Normal file
29
ui/view.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package ui
|
||||
|
||||
import "git.flowmade.one/flowmade-one/iris/internal/element"
|
||||
|
||||
type View struct {
|
||||
e element.Element
|
||||
}
|
||||
|
||||
func (v View) Child(child View) View {
|
||||
v.e.Child(child.e)
|
||||
return v
|
||||
}
|
||||
|
||||
func NewView() View {
|
||||
e := element.NewElement("div")
|
||||
e.JustifyItems("center")
|
||||
e.AlignItems("center")
|
||||
return View{e}
|
||||
}
|
||||
|
||||
// NewViewFromElement creates a View from an element (for advanced use cases)
|
||||
func NewViewFromElement(e element.Element) View {
|
||||
return View{e}
|
||||
}
|
||||
|
||||
// Element returns the underlying element (for advanced use cases)
|
||||
func (v View) Element() element.Element {
|
||||
return v.e
|
||||
}
|
||||
Reference in New Issue
Block a user