about

Fyne is an easy-to-use UI toolkit and application API written in Go. It is designed to build applications that run on desktops and mobile devices with a single code base.

Version 2.1 is the current version of the Fyne API, which introduces RichText and DocTabs containers, as well as document storage APIS and FyneApp.toml metadata support. We’re now working hard on the next big release, codenamed Bowmore, with more news to come in our news feed and GitHub project.

A prerequisite for

To develop applications using Fyne, you’ll need Go 1.14 or later, a C compiler, and development tools for your system. If you’re not sure if all of this is installed, or if you don’t know how, check out our getting started documentation.

Using standard Go tools, you can install Fyne’s core libraries in the following way.

$ go get fyne.io/fyne/v2
Copy the code

Gadget demo

To run Fyne’s feature show, perform the following procedure.

$ go get fyne.io/fyne/v2/cmd/fyne_demo/
$ fyne_demo
Copy the code

You should see something like this (after you click a few buttons).

Or if you use the Light theme.

It even runs on mobile devices.

An introduction to

Fyne’s design is very easy to code. If you’ve followed the previous steps, all you need is a Go IDE (or a text editor).

Open a new file and you’re ready to write your first application

package
Copy the code

And you can simply run it.

$ go run main.go
Copy the code

It should look something like this.

Note that Windows apps load from a command prompt by default, which means that if you click on an icon, you might see a command window. To fix this, add the parameter -ldFlags -h = WindowsGUI to your run or build commands.

Run in a mobile simulation

There is a useful mobile simulation mode that hints at how your application works on a mobile device.

$ go run -tags mobile main.go
Copy the code

The installation

Use Go Install to copy the executable files to your gobin directory. To install applications with ICONS and so on into your operating system’s standard application location, you can use the Fyne tool and the “Install” subcommand.

$ go get fyne.io/fyne/v2/cmd/fyne
$ fyne install
Copy the code

Pack for mobile devices

In order to run on mobile devices, it is necessary to package the application. To do this, we can use the “package “subcommand of the FYne tool. You will need to add the appropriate parameters as prompted, but the basic commands are shown below. Once packaged, you can install using the platform development tools or fyne “Install” subcommand.

$ fyne package -os android -appID my.domain.appname
$ fyne install -os android
Copy the code

Ready to release

Using the fyne tool’s “Publish” subcommand, you can package your application for distribution to the app store and marketplace. Make sure you have the standard build tools installed and set up accounts and signatures according to the platform documentation. You can then execute commands like the following, noting that the -os ios parameter allows ios applications to be built from macOS computers. Other combinations are ok 🙂

$ fyne release -os ios -certificate "Apple Distribution" -profile "My App Distribution" -appID "com.example.myapp"
Copy the code

The above command will create an ‘.ipa’ file that can then be uploaded to the iOS App Store.

The document

More documentation can be found on the Fyne developer website or at PKg.go.dev.

The sample

You can find many application instances in the instance library. Also, a list of apps that use FYne can be found on our website.

Shipment of Fyne kits

All Fyne apps can run without a pre-installed library, which is one of the reasons the app is so portable. However, if you want to support Fyne in a larger way on your operating system, there are utilities you can install to help achieve a more complete experience.

Additional applications

You are advised to install the following additional applications.

The application To get describe
fyne_settings fyne.io/fyne/v2/cmd/fyne_settings A GUI for managing your global Fyne Settings, such as themes and scaling
The application github.com/fyne-io/apps A graphical installer that lists Fyne’s applications at the urlapps.fyne.io

These are optional applications, but can help create a more complete desktop experience.

FyneDesk (Linux / BSD)

To fully use Fyne on your desktop/laptop, you can also install FyneDesk:)