Background and history

The andlabs UI project was created to provide a simple-to-use way to create native graphical applications using Go. The API is minimal as it aims to provide only what is necessary to create GUI programs. The core is a C library, which hides the platform-specific APIs, allowing the main library to manage the idiomatic considerations for a Go GUI API. Recently, the C library (libui) was moved to a separate project, which is included in the Go project for developers' convenience.

There is a demonstration of the widgets available included in the project—when run on a Linux computer, it will look like the following screenshot:

The widget demo from andlabs UI

As a platform-native implementation, the widgets in andlabs UI will look different on each operating system. On Windows and macOS, the library uses the native widget set, and on Linux it uses the GTK+ library. This approach creates applications that are consistent with other software on the current computer and so should be simple for users to understand. This approach is powerful and has substantial benefits, but can add complications for application developers. We will explore the benefits and challenges of such an approach within this chapter, but first let's get running with a simple hello world application.