8000 GitHub - lobehub/lobe-mygo: 🍭 Lobe MyGo - the UI kit for native Go apps: Lobe UI design language for MyGo, drawn on the GPU in pure Go · GitHub
[go: up one dir, main page]

Skip to content
lobehubPublic

About

🍭 Lobe MyGo - the UI kit for native Go apps: Lobe UI design language for MyGo, drawn on the GPU in pure Go

Topics

Resources

Stars

234 stars

Watchers

0 watching

Forks

Repository files navigation

Lobe MyGo

Lobe MyGo

The UI Kit for Native Go Apps

Lobe UI components for MyGo native UI, drawn on the GPU in pure Go.

Docs · Catalog · Changelog · Report Bug · Request Feature


Table of contents

TOC

✨ Why Lobe MyGo?

Lobe MyGo brings the Lobe UI design language to desktop apps written with MyGo's native UI: no HTML, no JavaScript and no webview.

  • Lobe UI, in Go: 70+ components (buttons, inputs, menus, modals, toasts, tabs and more) that look and move like their React counterparts.
  • Same tokens as Lobe UI: colors, radii and font sizes are generated from @lobehub/ui, so a Go app and a web app share one look.
  • Light and dark built in: theme.Apply follows the system appearance with no extra setup.
  • Pure Go, no cgo: one small binary per platform, cross-compiled from any machine.
  • Motion included: springs and shared-element transitions for indicators, overlays and toasts.
  • Lucide icons: all 2,300+ Lucide icons as Go functions.

🚀 Getting Started

$ go get github.com/lobehub/lobe-mygo

Lobe MyGo needs Go 1.27 or later and builds on MyGo.

package main

import (
	"fmt"
	"log"

	"github.com/egoist/mygo"
	"github.com/egoist/mygo/ui"
	"github.com/lobehub/lobe-mygo/pkg/action"
	"github.com/lobehub/lobe-mygo/pkg/theme"
)

var count int

func view(c *ui.Context) {
	theme.Apply(c)
	ui.Column(c).Fill().Center().Gap(12).Background(theme.TokensOf(c).BgContainer).Children(func() {
		if action.Button(c, "Hello Lobe", action.ButtonProps{Variant: action.Primary}).Clicked() {
			count++
		}
		ui.Text(c, fmt.Sprintf("Clicked %d times", count))
	})
}

func main() {
	mygo.App.WhenReady(func() {
		mygo.NewWindow(mygo.WindowOptions{Title: "Hello Lobe", Width: 480, Height: 320, Content: ui.View(view)})
	})
	if err := mygo.App.Run(); err != nil {
		log.Fatal(err)
	}
}

Call theme.Apply(c) at the top of each view, then read design tokens with theme.TokensOf(c).

To start a whole app, copy examples/desktop: a skeleton desktop window with a title bar, tabs with history, a resizable sidebar, a content card and a settings form, styled after the LobeHub desktop app. Run it with go run ./examples/desktop.

Components speak English and Simplified Chinese, in the language the app shows: an app that ships zh-Hans in its MyGo catalogs gets them in Chinese, and changes or translates any of their texts with lobe.<key> keys (see pkg/internal/l10n/messages/en.json). The starter shows both, with a language switch in Settings.

📦 Packages

Package Components
pkg/action Button, ActionIcon, ActionIconGroup, CopyButton, Segmented
pkg/field Input, TextArea, InputNumber, InputPassword, InputOTP, Select, AutoComplete, SearchBar, HotkeyInput, EditableText, DatePicker, Calendar, Upload
pkg/choice Checkbox, RadioGroup, Switch, Slider, Rate, ToggleGroup, ColorSwatches, ColorPicker, ImageSelect
pkg/display Text, Tag, Avatar, GroupAvatar, AgentAvatar, Icon, Hotkey, Image, List, Accordion, Empty, Skeleton
pkg/feedback Alert, Badge, Progress, Spin, Result, Modal, Drawer, Toast, FloatingPanel, FloatingSheet
pkg/overlay Tooltip, Popover, DropdownMenu, ContextMenu
pkg/nav Tabs, Pagination, Breadcrumb, Steps, Burger
pkg/layout Block, Grid, Divider, ScrollArea, DraggablePanel, Header, SideNav, DraggableSideNav, Layout, GuideCard, SortableList
pkg/code Highlighter, Snippet, QRCode
pkg/markdown Markdown, with streaming
pkg/theme Light and dark tokens, sizes, shadows
pkg/motion Springs, easings, transitions
pkg/lucide Lucide icons

📖 Documentation

The docs site shows every component as a live MyGo demo, compiled to WebAssembly and drawn in the browser, next to an API table generated from its Go Props struct.

$ bun install
$ bun run dev

💬 Community

Questions, ideas and showcases are all welcome:

⌨️ Local Development

Clone it for local development (Go >= 1.27 and Bun):

$ git clone https://github.com/lobehub/lobe-mygo.git
$ cd lobe-mygo
$ go test ./...
$ go run ./catalog            # native catalog window
$ go run ./catalog button/basic
$ go run ./examples/desktop    # desktop app starter
$ bun install && bun run dev  # docs site with WebAssembly demos

🤝 Contributing

Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub Issues to get stuck in to show us what you’re made of.

🩷 Sponsor

Every bit counts and your one-time donation sparkles in our galaxy of support! You're a shooting star, making a swift and bright impact on our journey. Thank you for believing in us – your generosity guides us toward our mission, one brilliant flash at a time.

🔗 Links


Copyright © 2026 LobeHub.
This project is MIT licensed.

About

🍭 Lobe MyGo - the UI kit for native Go apps: Lobe UI design language for MyGo, drawn on the GPU in pure Go

Topics

Resources

Stars

234 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages

0