Top Related Projects
Build smaller, faster, and more secure desktop applications with a web frontend.
:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Make any web page a desktop application
Portable and lightweight cross-platform desktop application development framework
:zap: Native, high-performance, cross-platform desktop apps - built with Reason!
Cross platform GUI toolkit in Go inspired by Material Design
Quick Overview
Wails is a framework for building desktop applications using web technologies (HTML, CSS, and JavaScript) and Go as the backend language. It provides a way to create cross-platform applications that can be packaged and distributed as native applications.
Pros
- Cross-platform: Wails allows you to build applications that can run on Windows, macOS, and Linux, making it easier to reach a wider audience.
- Native Integration: Wails integrates with the native operating system, allowing access to system-level APIs and providing a more native-like user experience.
- Flexibility: By using web technologies for the frontend and Go for the backend, Wails offers a flexible and powerful development environment.
- Performance: Go's performance characteristics make it a suitable choice for building the backend of desktop applications.
Cons
- Learning Curve: Developers who are more familiar with traditional desktop application development frameworks may need to invest time in learning the Wails approach.
- Dependency on Go: The requirement to use Go as the backend language may be a drawback for developers who are more comfortable with other programming languages.
- Limited Ecosystem: Compared to more established desktop application frameworks, the Wails ecosystem is relatively small, which may limit the availability of third-party libraries and tools.
- Documentation: While the Wails documentation is generally good, some areas may be less comprehensive or require more community support.
Getting Started
To get started with Wails, follow these steps:
- Install Go on your system. You can download it from the official Go website: https://golang.org/dl/.
- Install the Wails CLI by running the following command:
go install github.com/wailsapp/wails/cmd/wails@latest
- Create a new Wails project by running the following command:
wails init my-app
- Change to the project directory:
cd my-app
- Start the development server:
wails serve
- Open your web browser and navigate to
http://localhost:34115
to see your application running.
You can now start building your desktop application by modifying the main.go
and app.html
files in the my-app
directory.
Competitor Comparisons
Build smaller, faster, and more secure desktop applications with a web frontend.
Pros of Tauri
- Smaller bundle sizes due to native OS components
- Supports multiple programming languages for backend logic
- More robust security features and sandboxing
Cons of Tauri
- Steeper learning curve, especially for developers new to Rust
- Less mature ecosystem compared to Wails
- More complex build process and dependency management
Code Comparison
Tauri (main.rs):
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
fn main() {
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Wails (main.go):
package main
import (
"embed"
"log"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
)
//go:embed frontend/dist
var assets embed.FS
func main() {
app := NewApp()
err := wails.Run(&options.App{
Title: "My App",
Width: 1024,
Height: 768,
Assets: assets,
OnStartup: app.startup,
})
if err != nil {
log.Fatal(err)
}
}
Both frameworks allow for creating desktop applications using web technologies, but they differ in their approach and language choices. Tauri uses Rust for its core, while Wails is built with Go. The code examples show the entry points for both frameworks, highlighting their different syntaxes and setup processes.
:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Pros of Electron
- Larger ecosystem and community support
- Cross-platform compatibility (Windows, macOS, Linux)
- Extensive documentation and learning resources
Cons of Electron
- Larger application size due to bundled Chromium
- Higher memory usage and resource consumption
- Potential security vulnerabilities from web technologies
Code Comparison
Electron (JavaScript):
const { app, BrowserWindow } = require('electron')
function createWindow () {
const win = new BrowserWindow({ width: 800, height: 600 })
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
Wails (Go):
import "github.com/wailsapp/wails/v2/pkg/runtime"
func main() {
app := wails.CreateApp(&wails.AppConfig{
Width: 600,
Height: 400,
})
app.Run()
}
Wails uses Go for the backend and allows using web technologies for the frontend, resulting in smaller binaries and improved performance compared to Electron. However, Electron's mature ecosystem and extensive documentation make it easier for web developers to transition to desktop app development. Wails offers a more native feel and better resource efficiency, but with a smaller community and fewer learning resources.
Make any web page a desktop application
Pros of Nativefier
- Simpler setup and usage for basic web-to-desktop app conversion
- Supports a wider range of platforms, including Linux, macOS, and Windows
- Easier to create apps from existing websites without modifying source code
Cons of Nativefier
- Limited customization options compared to Wails
- Relies on Electron, which can lead to larger app sizes and higher resource usage
- Less flexibility for integrating native OS features and APIs
Code Comparison
Nativefier (CLI command):
nativefier --name "My App" "https://example.com"
Wails (Go code):
package main
import (
"github.com/wailsapp/wails/v2/pkg/runtime"
"github.com/wailsapp/wails/v2"
)
func main() {
app := wails.CreateApp(&wails.AppConfig{
Width: 1024,
Height: 768,
Title: "My App",
})
app.Run()
}
Wails offers more control over the application structure and allows for deeper integration with native APIs, while Nativefier provides a quicker solution for wrapping web applications into desktop apps with minimal configuration. Wails is better suited for developers who want to build custom desktop applications with Go, while Nativefier is ideal for quickly converting existing web apps to desktop versions.
Portable and lightweight cross-platform desktop application development framework
Pros of Neutralinojs
- Lighter weight and smaller bundle size
- Supports more programming languages (JavaScript, TypeScript, Python, Rust, etc.)
- Easier to get started with for web developers
Cons of Neutralinojs
- Less mature ecosystem and community compared to Wails
- Fewer built-in features and integrations
- Limited native API access compared to Wails' Go backend
Code Comparison
Neutralinojs (JavaScript):
Neutralino.init();
Neutralino.os.showMessageBox('Hello', 'Welcome to Neutralinojs!');
Wails (Go):
import "github.com/wailsapp/wails/v2/pkg/runtime"
func main() {
runtime.MessageDialog(ctx, runtime.MessageDialogOptions{
Title: "Hello",
Message: "Welcome to Wails!",
})
}
Both frameworks aim to simplify desktop application development using web technologies. Neutralinojs focuses on being lightweight and language-agnostic, making it easier for web developers to transition. Wails, on the other hand, leverages Go's power and provides deeper native integration, which can be beneficial for more complex applications requiring advanced system-level operations.
The choice between the two depends on the developer's familiarity with Go, the desired level of native integration, and the complexity of the application being built.
:zap: Native, high-performance, cross-platform desktop apps - built with Reason!
Pros of Revery
- Uses OCaml, offering strong type safety and functional programming benefits
- Provides a native UI toolkit with cross-platform support
- Leverages React-like concepts for building user interfaces
Cons of Revery
- Smaller community and ecosystem compared to Wails
- Steeper learning curve for developers not familiar with OCaml
- Less mature and fewer production-ready applications
Code Comparison
Revery (OCaml):
let app = App.create ();
let _ =
App.start app
(fun window =>
<View>
<Text text="Hello, World!" />
</View>);
Wails (Go):
func main() {
app := wails.CreateApp(&wails.AppConfig{
Width: 600,
Height: 400,
Title: "My Wails App",
})
app.Bind(basic)
err := app.Run()
if err != nil {
log.Fatal(err)
}
}
Summary
Revery offers a unique approach to building cross-platform desktop applications using OCaml and React-like concepts. It provides strong type safety and a native UI toolkit. However, it has a smaller community and a steeper learning curve compared to Wails. Wails, on the other hand, uses Go and provides a more familiar development experience for web developers, with a larger ecosystem and more production-ready applications.
Cross platform GUI toolkit in Go inspired by Material Design
Pros of Fyne
- Pure Go implementation, no CGo or external dependencies required
- Cross-platform support for desktop and mobile applications
- Simpler API and faster development for basic GUI applications
Cons of Fyne
- Limited native OS integration and look-and-feel
- Smaller ecosystem and community compared to Wails
- Less flexibility for integrating with existing web technologies
Code Comparison
Fyne example:
package main
import (
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Hello")
w.SetContent(widget.NewLabel("Hello Fyne!"))
w.ShowAndRun()
}
Wails example:
package main
import (
"github.com/wailsapp/wails/v2/pkg/runtime"
"github.com/wailsapp/wails"
)
func main() {
app := wails.CreateApp(&wails.AppConfig{
Width: 600,
Height: 400,
Title: "My Wails App",
})
app.Run()
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Build desktop applications using Go & Web Technologies.
English · ç®ä½ä¸æ · æ¥æ¬èª · íêµì´ · Español · Português · Ð ÑÑÑкий · Francais · Uzbek · Deutsch · Türkçe
Table of Contents
- Table of Contents
- Introduction
- Features
- Getting Started
- Sponsors
- FAQ
- Stargazers over time
- Contributors
- License
- Inspiration
Introduction
The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
Features
- Use standard Go for the backend
- Use any frontend technology you are already familiar with to build your UI
- Quickly create rich frontends for your Go programs using pre-built templates
- Easily call Go methods from Javascript
- Auto-generated Typescript definitions for your Go structs and methods
- Native Dialogs & Menus
- Native Dark / Light mode support
- Supports modern translucency and "frosted window" effects
- Unified eventing system between Go and Javascript
- Powerful cli tool to quickly generate and build your projects
- Multiplatform
- Uses native rendering engines - no embedded browser!
Roadmap
The project roadmap may be found here. Please consult it before creating an enhancement request.
Getting Started
The installation instructions are on the official website.
Sponsors
This project is supported by these kind people / companies:
FAQ
-
Is this an alternative to Electron?
Depends on your requirements. It's designed to make it easy for Go programmers to make lightweight desktop applications or add a frontend to their existing applications. Wails does offer native elements such as menus and dialogs, so it could be considered a lightweight electron alternative.
-
Who is this project aimed at?
Go programmers who want to bundle an HTML/JS/CSS frontend with their applications, without resorting to creating a server and opening a browser to view it.
-
What's with the name?
When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to Ruby". So initially it was a play on words (Webview on Rails). It just so happened to also be a homophone of the English name for the Country I am from. So it stuck.
Stargazers over time
Contributors
The contributors list is getting too big for the readme! All the amazing people who have contributed to this project have their own page here.
License
Inspiration
This project was mainly coded to the following albums:
- Manic Street Preachers - Resistance Is Futile
- Manic Street Preachers - This Is My Truth, Tell Me Yours
- The Midnight - Endless Summer
- Gary Newman - Savage (Songs from a Broken World)
- Steve Vai - Passion & Warfare
- Ben Howard - Every Kingdom
- Ben Howard - Noonday Dream
- Adwaith - Melyn
- Gwidaith Hen Fran - Cedors Hen Wrach
- Metallica - Metallica
- Bloc Party - Silent Alarm
- Maxthor - Another World
- Alun Tan Lan - Y Distawrwydd
Top Related Projects
Build smaller, faster, and more secure desktop applications with a web frontend.
:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Make any web page a desktop application
Portable and lightweight cross-platform desktop application development framework
:zap: Native, high-performance, cross-platform desktop apps - built with Reason!
Cross platform GUI toolkit in Go inspired by Material Design
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot