vlang/gui

An immediate mode UI framework for the V language

193

stars

1,341

commits

V

primary language

Jul 20, 2026

updated

README

GUI

Stars Forks Issues License

An immediate-mode UI framework for V that stays out of your way.

Windows native support is under active validation. The current documented path uses native Windows with MSVC/vcpkg and is tracked in docs/WINDOWS.md; this is not yet a claim of full Windows parity.

showcase

Motivation

Most UI frameworks want you to think about data binding, observables, and UI thread synchronization. v-gui doesn't. Your view is just a function of your state—change the state anywhere and the UI updates. No wiring. No callbacks to remember. No threading headaches.

The layout engine is inspired by Clay, a fast layout algorithm that makes flex-box style layouts simple to reason about.

V is a simple language. It deserves a simple UI framework.

Who Is This For?

Good fit if you want:

  • State as plain structs, no observables
  • Thread-safe UI updates from anywhere
  • Code-defined layouts (no XML, no designers)
  • Desktop apps, tools, data viewers, games

Maybe not if you need:

  • Mature accessibility support (work in progress)
  • Production mobile apps
  • Native platform widgets
  • Drag-and-drop UI designers

Features

Layout

  • Flex-box rows and columns
  • Fit/fill/fixed sizing per axis
  • Scroll containers with momentum
  • Nested layouts to any depth

Widgets (30+)

  • Text, inputs, textareas
  • Buttons, toggles, switches, checkboxes, radio buttons
  • Dropdowns, listboxes, tables, data grids, trees, markdown
  • Menus, menubars, tabs, splitters, dialogs
  • Progress bars, tooltips, date pickers
  • Native open/save/folder dialogs (macOS + Linux; Windows under validation)

Rendering

  • SDF-based drop shadows
  • Linear and radial gradients
  • Blur effects
  • Custom fragment shaders (Metal + GLSL)
  • Full SVG support (paths, transforms, groups, strokes)
  • Mermaid diagram rendering

Animation

  • Tweens with easing curves
  • Physics-based springs
  • Automatic layout transitions
  • Hero morphs between views

Text (via vglyph/Pango)

  • Subpixel positioning and hinting
  • Rich text with mixed styles in a single widget
  • Rotated and affine-transformed text
  • Bidirectional text, ligatures, emoji
  • Full Unicode and OpenType support
  • IME support for CJK and other complex input methods

Architecture

  • Thread-safe state updates
  • 60 FPS with 1000+ widgets
  • Pure V, no C bindings in user code

Quick Start

import gui

@[heap]
struct App {
pub mut:
	clicks int
}

fn main() {
	mut window := gui.window(
		state: &App{}
		on_init: fn (mut w gui.Window) { w.update_view(main_view) }
	)
	window.run()
}

fn main_view(window &gui.Window) gui.View {
	app := window.state[App]()
	return gui.column(
		h_align: .center
		v_align: .middle
		content: [
			gui.text(text: '${app.clicks} clicks'),
			gui.button(
				content: [gui.text(text: 'Click me')]
				on_click: fn (_ &gui.Layout, mut _ gui.Event, mut w gui.Window) {
					w.state[App]().clicks += 1
				}
			),
		]
	)
}

See GET_STARTED.md for a detailed walkthrough.

Installation

v install gui

Dependencies

PackagePurposeSource
vglyphText renderingAuto-installed with v-gui
gg2D graphicsV standard library
sokol.sappWindowing and eventsV standard library

Documentation

DocumentDescription
GET_STARTED.mdTutorial: first app to working knowledge
ARCHITECTURE.mdHow v-gui works under the hood
LAYOUT_ALGORITHM.mdSizing, alignment, and positioning
ANIMATIONS.mdTweens, springs, and transitions
SVG.mdVector graphics and icon rendering
MARKDOWN.mdMarkdown rendering
TABLES.mdTable widget and data display
DATA_GRID.mdData grid widget and API
FORMS.mdForm runtime, validation model, and field adapters
GRADIENTS.mdLinear and radial gradients
SHADERS.mdCustom fragment shaders
PRINTING.mdPDF export and platform print flow
WINDOWS.mdWindows setup and validation notes, not a final support claim
WINDOWS_MANUAL_SMOKE.mdManual Windows smoke checklist
SPLITTER.mdSplitter component (drag, collapse, keyboard)

Generate API docs with:

v run _doc.vsh

Examples

The examples/ folder contains working apps for every feature:

v run examples/get_started.v    # Start here
v run examples/buttons.v        # Button variants
v run examples/animations.v     # Tweens and springs
v run examples/tiger.v          # SVG rendering demo
v run examples/markdown.v       # Markdown rendering
v run examples/dialogs.v        # Custom + native dialogs
v run examples/split_panel.v    # Splitter + nested splitter
v run examples/printing.v       # PDF export + platform print flow
v run examples/input_masks.v    # Input mask presets and custom tokens
v run examples/numeric_input.v  # Locale-aware numeric input + step controls
v run examples/form_validation.v # Form validation with sync+async validators
v run examples/text_transform.v # Rotated and affine text
v run examples/table_demo.v     # Table widget demo
v run examples/data_grid_demo.v # Data grid widget demo
v run examples/custom_shader.v  # Custom fragment shaders
v run examples/snake.v          # A complete game

Status

v-gui is in active development. Join the discussion on Discord.

Contributing

Contributions welcome:

  • Report bugs and request features via GitHub issues
  • Submit pull requests
  • Improve documentation

License

MIT

Contributors

mike-ward

1,213 commits

spytheman

60 commits

ddkwork

30 commits

GGRei

10 commits

vlang/gui

An immediate mode UI framework for the V language

193

stars

1,341

commits

V

primary language

Jul 20, 2026

updated

README

GUI

Stars Forks Issues License

An immediate-mode UI framework for V that stays out of your way.

Windows native support is under active validation. The current documented path uses native Windows with MSVC/vcpkg and is tracked in docs/WINDOWS.md; this is not yet a claim of full Windows parity.

showcase

Motivation

Most UI frameworks want you to think about data binding, observables, and UI thread synchronization. v-gui doesn't. Your view is just a function of your state—change the state anywhere and the UI updates. No wiring. No callbacks to remember. No threading headaches.

The layout engine is inspired by Clay, a fast layout algorithm that makes flex-box style layouts simple to reason about.

V is a simple language. It deserves a simple UI framework.

Who Is This For?

Good fit if you want:

  • State as plain structs, no observables
  • Thread-safe UI updates from anywhere
  • Code-defined layouts (no XML, no designers)
  • Desktop apps, tools, data viewers, games

Maybe not if you need:

  • Mature accessibility support (work in progress)
  • Production mobile apps
  • Native platform widgets
  • Drag-and-drop UI designers

Features

Layout

  • Flex-box rows and columns
  • Fit/fill/fixed sizing per axis
  • Scroll containers with momentum
  • Nested layouts to any depth

Widgets (30+)

  • Text, inputs, textareas
  • Buttons, toggles, switches, checkboxes, radio buttons
  • Dropdowns, listboxes, tables, data grids, trees, markdown
  • Menus, menubars, tabs, splitters, dialogs
  • Progress bars, tooltips, date pickers
  • Native open/save/folder dialogs (macOS + Linux; Windows under validation)

Rendering

  • SDF-based drop shadows
  • Linear and radial gradients
  • Blur effects
  • Custom fragment shaders (Metal + GLSL)
  • Full SVG support (paths, transforms, groups, strokes)
  • Mermaid diagram rendering

Animation

  • Tweens with easing curves
  • Physics-based springs
  • Automatic layout transitions
  • Hero morphs between views

Text (via vglyph/Pango)

  • Subpixel positioning and hinting
  • Rich text with mixed styles in a single widget
  • Rotated and affine-transformed text
  • Bidirectional text, ligatures, emoji
  • Full Unicode and OpenType support
  • IME support for CJK and other complex input methods

Architecture

  • Thread-safe state updates
  • 60 FPS with 1000+ widgets
  • Pure V, no C bindings in user code

Quick Start

import gui

@[heap]
struct App {
pub mut:
	clicks int
}

fn main() {
	mut window := gui.window(
		state: &App{}
		on_init: fn (mut w gui.Window) { w.update_view(main_view) }
	)
	window.run()
}

fn main_view(window &gui.Window) gui.View {
	app := window.state[App]()
	return gui.column(
		h_align: .center
		v_align: .middle
		content: [
			gui.text(text: '${app.clicks} clicks'),
			gui.button(
				content: [gui.text(text: 'Click me')]
				on_click: fn (_ &gui.Layout, mut _ gui.Event, mut w gui.Window) {
					w.state[App]().clicks += 1
				}
			),
		]
	)
}

See GET_STARTED.md for a detailed walkthrough.

Installation

v install gui

Dependencies

PackagePurposeSource
vglyphText renderingAuto-installed with v-gui
gg2D graphicsV standard library
sokol.sappWindowing and eventsV standard library

Documentation

DocumentDescription
GET_STARTED.mdTutorial: first app to working knowledge
ARCHITECTURE.mdHow v-gui works under the hood
LAYOUT_ALGORITHM.mdSizing, alignment, and positioning
ANIMATIONS.mdTweens, springs, and transitions
SVG.mdVector graphics and icon rendering
MARKDOWN.mdMarkdown rendering
TABLES.mdTable widget and data display
DATA_GRID.mdData grid widget and API
FORMS.mdForm runtime, validation model, and field adapters
GRADIENTS.mdLinear and radial gradients
SHADERS.mdCustom fragment shaders
PRINTING.mdPDF export and platform print flow
WINDOWS.mdWindows setup and validation notes, not a final support claim
WINDOWS_MANUAL_SMOKE.mdManual Windows smoke checklist
SPLITTER.mdSplitter component (drag, collapse, keyboard)

Generate API docs with:

v run _doc.vsh

Examples

The examples/ folder contains working apps for every feature:

v run examples/get_started.v    # Start here
v run examples/buttons.v        # Button variants
v run examples/animations.v     # Tweens and springs
v run examples/tiger.v          # SVG rendering demo
v run examples/markdown.v       # Markdown rendering
v run examples/dialogs.v        # Custom + native dialogs
v run examples/split_panel.v    # Splitter + nested splitter
v run examples/printing.v       # PDF export + platform print flow
v run examples/input_masks.v    # Input mask presets and custom tokens
v run examples/numeric_input.v  # Locale-aware numeric input + step controls
v run examples/form_validation.v # Form validation with sync+async validators
v run examples/text_transform.v # Rotated and affine text
v run examples/table_demo.v     # Table widget demo
v run examples/data_grid_demo.v # Data grid widget demo
v run examples/custom_shader.v  # Custom fragment shaders
v run examples/snake.v          # A complete game

Status

v-gui is in active development. Join the discussion on Discord.

Contributing

Contributions welcome:

  • Report bugs and request features via GitHub issues
  • Submit pull requests
  • Improve documentation

License

MIT

Contributors

mike-ward

1,213 commits

spytheman

60 commits

ddkwork

30 commits

GGRei

10 commits

Languages

V

78.0%

C

19.8%

Objective-C

1.8%