Fyne: A Cross-Platform GUI Toolkit in Go Inspired by Material Design

Summary
Fyne is an easy-to-use UI toolkit and application API written in Go, designed to build cross-platform applications. It allows developers to create desktop and mobile apps from a single codebase, drawing inspiration from Material Design principles. With Fyne, you can develop elegant and functional graphical user interfaces efficiently.
Repository Info
Introduction
Fyne is an easy-to-use UI toolkit and application API written in Go. It is designed to build applications that run on desktop and mobile devices with a single codebase, inspired by Material Design. This powerful toolkit simplifies GUI development, allowing developers to create elegant and performant applications across various platforms including Android, iOS, Windows, macOS, and Linux.
Installation
To get started with Fyne, you will need Go version 1.17 or later, a C compiler, and your system's development tools. Once these prerequisites are met, you can install Fyne's core library using the standard Go tools:
go get fyne.io/fyne/v2@latest
After importing a new module, run the following command before compiling your code for the first time:
go mod tidy
You can also run a showcase of Fyne's features by installing and running the demo application:
go install fyne.io/fyne/v2/cmd/fyne_demo@latest
fyne_demo
Examples
Fyne is designed for ease of coding. Here is a simple "Hello Fyne!" application:
package main
import (
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Hello")
hello := widget.NewLabel("Hello Fyne!")
w.SetContent(container.NewVBox(
hello,
widget.NewButton("Hi!", func() {
hello.SetText("Welcome :)")
}),
))
w.ShowAndRun()
}
You can run this application with:
go run main.go
For more examples, explore the Fyne examples repository.
Why Use Fyne?
Fyne offers several compelling reasons for developers to choose it for GUI development:
- Cross-Platform Compatibility: Build applications for desktop (Windows, macOS, Linux) and mobile (Android, iOS) from a single Go codebase.
- Material Design Inspired: Applications built with Fyne feature a modern, clean, and consistent user interface inspired by Google's Material Design.
- Simplicity and Ease of Use: The API is designed to be straightforward, allowing developers to quickly create functional and aesthetically pleasing GUIs.
- Go Native: Leveraging the power and performance of the Go language, Fyne applications are efficient and robust.
- No External Dependencies: Fyne applications are self-contained and do not require pre-installed libraries on the target system, making them highly portable.
Links
- GitHub Repository: https://github.com/fyne-io/fyne
- Official Website: https://fyne.io
- Developer Documentation: https://developer.fyne.io/
- Go API Reference: https://pkg.go.dev/fyne.io/fyne/v2?tab=doc
- Examples Repository: https://github.com/fyne-io/examples/
- Applications Built with Fyne: https://apps.fyne.io/