flarin

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: MIT Imports: 5 Imported by: 0

README

Flarin UI --- Modern UI for Go

Flarin UI is a fast, reliable, and flexible UI framework designed to bring the Go language to the level of modern JavaScript-based frontend development.


✨ Features (Goals)

  • 🚀 Component-based architecture
    Modern React/Flutter-like component concepts.

  • Ultra-fast render pipeline
    Minimal memory usage, maximum performance.

  • 🧩 Reactive state management
    Predictable, simple, and reactive state system.

  • 🌐 Built‑in router
    SPA routing baked in.

  • 🎛️ SSR & Static Rendering (Planned)
    Go‑based rendering for both backend and frontend.

  • 📦 Zero JavaScript requirement (Goal)
    Reduce or eliminate JS dependencies where possible.


🎯 Vision

Bring Golang to the same level as JavaScript for modern UI development.

Flarin UI is the first project of the upcoming Flarin ecosystem.
Coming soon: - Flarin App --- mobile app development with Go\

  • Flarin CLI --- project generation & tooling

📦 Installation

go get github.com/flarin-org/flarin

🧪 Example

package main

import (
    "github.com/flarin-org/flarin"
)

func main() {
    app := flarin.NewUI()

    app.Body(
        flarin.H1("Hello FlarinUI")
    )
}

📅 Roadmap

🚧 v1.0 --- Prototype
  • Component system\
  • Basic renderer\
  • Reactive core\
  • Minimal router

🤝 Contributing

Contributions are welcome.
Issues and PRs will open as the project structure stabilizes.


📜 License

MIT License.


🌟 Support

Give the project a star to support development!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(rs ...Route)

func Start

func Start(addr string)

func UseState added in v1.0.1

func UseState(ctx Ctx, key string, initial interface{}) (interface{}, func(interface{}))

UseState hook for state management

Types

type Ctx

type Ctx struct {
	Req     *http.Request
	Res     http.ResponseWriter
	State   map[string]interface{}
	Session *sessions.Session
}

type Modifier added in v1.0.1

type Modifier func(*Props)

func Bg added in v1.0.1

func Bg(c string) Modifier

func Color added in v1.0.1

func Color(c string) Modifier

func FontSize added in v1.0.1

func FontSize(px int) Modifier

func Height added in v1.0.1

func Height(px int) Modifier

func Id added in v1.0.1

func Id(id string) Modifier

func Margin added in v1.0.1

func Margin(px int) Modifier

func MarginBottom added in v1.0.1

func MarginBottom(px int) Modifier

func MarginLeft added in v1.0.1

func MarginLeft(px int) Modifier

func MarginRight added in v1.0.1

func MarginRight(px int) Modifier

func MarginTop added in v1.0.1

func MarginTop(px int) Modifier

func Name added in v1.0.1

func Name(name string) Modifier

func OnChange added in v1.0.1

func OnChange(fn interface{}) Modifier

func OnClick added in v1.0.1

func OnClick(fn interface{}) Modifier

func Padding added in v1.0.1

func Padding(px int) Modifier

func Placeholder added in v1.0.1

func Placeholder(text string) Modifier

func Rounded added in v1.0.1

func Rounded(px int) Modifier

func Type added in v1.0.1

func Type(t string) Modifier

func Value added in v1.0.1

func Value(val string) Modifier

func Width added in v1.0.1

func Width(px int) Modifier

type Node added in v1.0.1

type Node struct {
	Tag      string
	Text     string
	Props    *Props
	Children []Node
}

type Props added in v1.0.1

type Props struct {
	Styles map[string]string
	Events map[string]string
	Attrs  map[string]string
}

func NewProps added in v1.0.1

func NewProps() *Props

type Route

type Route struct {
	Path    string
	Handler func(Ctx) Widget
}

func RouteFunc

func RouteFunc(path string, h func(Ctx) Widget) Route

type UI

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

func NewUI

func NewUI() *UI

func (*UI) Body

func (u *UI) Body(w Widget)

func (*UI) CssFile

func (u *UI) CssFile(path string)

func (*UI) Run

func (u *UI) Run(addr string)

type Widget added in v1.0.1

type Widget interface {
	Render() Node
}

func Button added in v1.0.1

func Button(children ...interface{}) Widget

func Div added in v1.0.1

func Div(children ...Widget) Widget

func Form added in v1.0.1

func Form(action string, method string, children ...Widget) Widget

func H1 added in v1.0.1

func H1(children ...interface{}) Widget

func H2 added in v1.0.1

func H2(children ...interface{}) Widget

func H3 added in v1.0.1

func H3(children ...interface{}) Widget

func H4 added in v1.0.1

func H4(children ...interface{}) Widget

func H5 added in v1.0.1

func H5(children ...interface{}) Widget

func H6 added in v1.0.1

func H6(children ...interface{}) Widget

func Input added in v1.0.1

func Input(mods ...Modifier) Widget
func Link(href string, text string, mods ...Modifier) Widget

func P added in v1.0.1

func P(children ...interface{}) Widget

func Text added in v1.0.1

func Text(value string, mods ...Modifier) Widget

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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