nui

command module
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

nui - Native UI Library for Go

Native gateway between OS UI & Golang with minimum dependencies, plus a forms/widgets library built on top of it.

Documentation: doc/README.md

go get github.com/randstev/nui

Packages

Package Import path Purpose
ui github.com/randstev/nui/ui forms, widgets, dialogs, themes
i18n github.com/randstev/nui/ui/i18n translations

Keyboard and mouse types (ui.Key, ui.KeyModifiers, ui.MouseButton, ui.MouseCursor and their constants) are part of ui. The native layer lives in internal/ and is not importable by applications.

Example

package main

import "github.com/randstev/nui/ui"

func main() {
	form := ui.NewForm()
	form.SetTitle("Example 01 - Base Form")
	form.Exec()
}

Runnable demos: go run . opens the launcher of the example applications in examples/ (notepad, calculator, contacts, file explorer, paint, tasks, network monitor, unit converter, function plotter); go run . notepad runs one of them.

Operating Systems

  • Linux
  • Windows
  • MacOS

Base Widgets

  • Button
  • ComboBox
  • ContextMenu
  • Dialog
  • HSpacer
  • Label
  • Panel
  • Splitter
  • Table
  • TabWidget
  • TextBox
  • VSpacer

Linux build

  • go build -o bin/nui ./main.go

No C compiler or X11 headers needed to build (the Linux backend talks to Xlib at runtime via purego, not cgo), so this also cross-compiles from macOS/Windows with a plain GOOS=linux go build. libX11.so still has to be present on whatever machine actually runs the binary - true of virtually any Linux desktop (GNOME/KDE, even under Wayland via XWayland).

Windows build

  • go build -o bin/nui.exe -ldflags="-H=windowsgui"

macOS build

  • go build -o bin/nui ./main.go

No C compiler or Xcode command line tools needed to build (the macOS backend talks to Cocoa/AppKit at runtime via purego, not cgo), so this also cross-compiles from Linux/Windows with a plain GOOS=darwin go build. AppKit still has to be present on whatever machine actually runs the binary - true of every macOS install.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package examples is a set of small applications built with the ui package: each shows the widgets the way a real program uses them.
Package examples is a set of small applications built with the ui package: each shows the widgets the way a real program uses them.
icons
Package icons draws the small icons the example applications use for their menus and toolbars, so the examples need no image files; an application would load its own (e.g.
Package icons draws the small icons the example applications use for their menus and toolbars, so the examples need no image files; an application would load its own (e.g.
monitor
Package monitor is the Network Monitor example: a dashboard that pings a few simulated servers once a second and charts the results.
Package monitor is the Network Monitor example: a dashboard that pings a few simulated servers once a second and charts the results.
notepad
Package notepad is a primitive text editor: one text file at a time, with the usual File, Edit, View and Help menus.
Package notepad is a primitive text editor: one text file at a time, with the usual File, Edit, View and Help menus.
paint
Package paint is a tiny raster paint program.
Package paint is a tiny raster paint program.
plotter
Package plotter is a function plotter: type a formula of x and see its graph.
Package plotter is a function plotter: type a formula of x and see its graph.
internal
ui
i18n
Package i18n holds the translations of an application as Go code: the strings are the fields of a struct, and each language is a value of it.
Package i18n holds the translations of an application as Go code: the strings are the fields of a struct, and each language is a value of it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL