Gio implements portable immediate mode GUI programs in Go. Gio programs run on all the major platforms: iOS/tvOS, Android, Linux (Wayland/X11), macOS, Windows, FreeBSD, OpenBSD, and experimental support for browsers (Webassembly/WebGL).
Gio includes an efficient vector renderer based on the Pathfinder project (https://github.com/servo/pathfinder). Text and other shapes are rendered using only their outlines without baking them into texture images, to support efficient animations, transformed drawing and pixel resolution independence.
This is a screenshot of the Kitchen example. If your browser supports WebAssembly and WebGL, run the example by pressing run.
Gio is designed to work with very few dependencies. It depends only on the platform libraries for window management, input and GPU drawing.
Running Gio programs
With Go 1.13 or newer, initialize a new module and run the “hello” example:
$ go mod init example.com $ go run gioui.org/example/hello
should display a simple message in a window.
$ go run gioui.org/example/kitchen
is another example that demonstrates the material design widgets.
Running on mobiles
For Android, iOS, tvOS the
gogio tool can build and package a Gio program for you.
To build an Android .apk file from the
$ go run gioui.org/cmd/gogio -target android gioui.org/example/kitchen
To build for the iOS simulator:
$ go run gioui.org/cmd/gogio -target ios -appid <bundle-id> gioui.org/example/gophers
See the running on mobile page for more information.
To run a Gio program in a compatible browser, the
gogio tool can output a directory ready to
serve. With the
goxec tool you don’t even need a web server:
$ go run gioui.org/cmd/gogio -target js gioui.org/example/gophers $ go get github.com/shurcooL/goexec $ goexec 'http.ListenAndServe(":8080", http.FileServer(http.Dir("gophers")))'
Open http://localhost:8080 in a browser to run the program.
Integration with existing projects
See the integration guide for details on using Gio with existing projects.
Programs using Gio
- Scatter, an implementation of the Signal protocol over email.
- Immediate Mode GUI Programming
- Gophercon 2019 talk about Gio and Scatter. Slides, Demos.
- Gophercon UK 2019 talk demonstrating a Gio program built from scratch. Slides, Demos.
The source code for Gio is hosted on sourcehut.
File bugs and TODOs through the issue tracker or send an email to ~firstname.lastname@example.org. For general discussion, use the ~email@example.com mailing list or the #gioui Gophers Slack channel.
Post patches to the gio-patches list. No Sourcehut account is required and you can post without being subscribed.
See the contribution guide for more details.
Dual-licensed under UNLICENSE or the MIT.
Gio’s main developer is working full-time on Gio, 100% supported by sponsorships. Please consider sponsoring Gio if you find it useful. Sponsorships are handled by GitHub Sponsors and are easy to set up.
Bitcoin donations are gladly accepted to bc1q8xw95urett00f4xs3v66p2l6xp2mfk5erpe5ug. Donations will go toward hosting expenses and for supporting the author’s full time work on Gio.