Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple_gg - Cross-Platform SimpleGUI for V

simple_gg is a lightweight, beginner-friendly UI framework for building native, hardware-accelerated desktop applications in V. Built on top of V's native gg graphics module (powered by Sokol), simple_gg delivers smooth performance and uniform UI rendering across macOS, Linux, and Windows without relying on external C/Obj-C dependencies.


🎨 Visual Showcase & Snapshots of All Examples

Quickstart Demo Dashboard App Demo

Advanced Controls Demo RAD Controls Showcase

Modern UI Showcase Data & Event Binding

📸 Click to view all 17 example screenshots

01 - Quickstart Demo 02 - Theme Gallery Demo

03 - Layout Containers Demo 04 - Component Gallery Demo

05 - Nameless Shortcuts Demo 06 - Interactive Dashboard Demo

07 - Advanced Controls Demo 08 - RAD Application Builder Demo

09 - Control Customization Demo 10 - More UI Controls Demo

11 - Data Table Pro Demo 12 - System & Stdlib Toolkit Demo

13 - Reactive State Store Demo 14 - RAD Controls Showcase Demo

15 - Modern UI Features Showcase Demo 16 - Interval Timers Demo

17 - Data & Event Binding Demo


✨ Key Features

  • Cross-Platform: Runs natively on macOS, Linux, and Windows with native OS drag-and-drop support.
  • 🎨 17 Built-in Production Themes: Apple Light/Dark, Nord, Dracula, Cyberpunk, Catppuccin Mocha, GitHub Dark/Light, Solarized, etc.
  • 🛠️ RAD Development Controls Suite: Multi-select Tag Input, Dual-Thumb Range Slider, Monospace Code Editor, File Drop Zone, Property Grid Inspector, Sparkline Micro-Charts, Pagination Bar, Resizable Split View, Toast Notification Overlay Stack, Command Palette (Ctrl+K), and Context Menus.
  • 🧩 Complete Widget Set: ListBox (interactive single/multi select), ComboBox, Transfer List, Console Output Viewer, Color Palette Swatch Grid, Status Bar, Step Slider, text/password inputs, steppers, range sliders, toggle switches, checkboxes, dropdowns, segmented controls, rating stars, date pickers, metric cards, charts, tree views, data tables, breadcrumbs, avatars, status badges, accordions, and alert banners.
  • 📐 Layout Engine: Automatic vertical stacking, horizontal rows (begin_row), multi-column grids (begin_grid), flexboxes (begin_flex_box), tab containers, and group cards.
  • 🔄 Reactive State Management (state.v): Key-value reactive store (set_state, get_state), typed accessors, reactive state listeners (on_state_change), and JSON disk persistence (save_state_json, load_state_json).
  • 💻 OS & System Extensions (sys.v): Native notifications, hardware/RAM/CPU inspection, system process execution, clipboard access, environment variables, system directories, and file operations.
  • 🛠️ V Standard Library Integrations (stdlib.v): Built-in fluent helpers for HTTP requests, RegEx matching, Cryptography (SHA256, MD5, AES, Bcrypt), Gzip/Zlib/Zstd compression, TOML parsing, SemVer checks, and WebSockets.
  • 🚀 Beginner Friendly: Fluent chainable builder API with zero boilerplate.

⚡ Quick Start

module main

import simplegui

fn main() {
	mut win := simplegui.new_simple_window('My App', 520, 380)
	win.set_theme('Apple Dark')
	win.add_heading('SimpleGUI Starter')
	win.add_form_field('Name:', 'username', 'Ada Lovelace')
	win.add_checkbox('agree', 'I agree to the Terms', true)

	win.add_button('btn_save', 'Save')
	win.on_click('btn_save', fn (mut win simplegui.SimpleWindow) {
		println("User: ${win.get_text('username')}")
	})

	win.run()
}

📁 Beginner-Friendly Examples & Snapshots

The repository includes beginner-friendly example programs in the examples/ directory:

Example Description Run Command Snapshot
01_quickstart.v First starter app with inputs and button callbacks. v run examples/01_quickstart.v Snapshot 01
02_theme_gallery.v Live theme switcher across 34 production palettes. v run examples/02_theme_gallery.v Snapshot 02
03_layout_containers.v Horizontal rows, multi-column grids, and group cards. v run examples/03_layout_containers.v Snapshot 03
04_widgets_and_forms.v Form inputs, sliders, steppers, ratings, dates, and metric cards. v run examples/04_widgets_and_forms.v Snapshot 04
05_nameless_shortcuts.v Rapid prototyping using nameless shortcuts (win.input()). v run examples/05_nameless_shortcuts.v Snapshot 05
06_dashboard_app.v Real-world dashboard with KPI metrics, charts, and actions. v run examples/06_dashboard_app.v Snapshot 06
07_advanced_controls.v Data tables, tab containers, tree views, search, breadcrumbs, avatars, and shortcuts. v run examples/07_advanced_controls.v Snapshot 07
08_rad_development.v Rapid app builder with batch ops, JSON form export, clipboard, and OS dialogs. v run examples/08_rad_development.v Snapshot 08
09_control_customization.v Custom geometry, margins/padding, colors, borders, and fluent control chaining. v run examples/09_control_customization.v Snapshot 09
10_more_controls.v Icon buttons, toolbars, hyperlinks, checklists, chips, and password strength meter. v run examples/10_more_controls.v Snapshot 10
11_data_table_pro.v Sortable data tables, wheel scrolling, row hover, and table manipulation. v run examples/11_data_table_pro.v Snapshot 11
12_system_and_stdlib_features.v Desktop notifications, hardware specs, clipboard, system paths, HTTP GET, RegEx, Crypto. v run examples/12_system_and_stdlib_features.v Snapshot 12
13_reactive_state_store.v Reactive key-value state store, typed accessors, state change listeners, and JSON disk persistence. v run examples/13_reactive_state_store.v Snapshot 13
14_rad_controls_showcase.v RAD & Advanced Suite: ListBox, Multi-Select ListBox, ComboBox, Transfer List, Code Editor, Console Log, Color Palette, Step Slider, Status Bar, Tag Input, Range Slider, Drop Zone, Property Grid, Sparkline, Pagination, Split View, Toasts, Command Palette, Context Menu. v run examples/14_rad_controls_showcase.v Snapshot 14
15_modern_ui_features_showcase.v Modern UI Showcase: Window controls, themes, layouts, forms, state store, system utilities. v run examples/15_modern_ui_features_showcase.v Snapshot 15
16_interval_timers.v Interval Timers & Timeouts: Recurring timers, timeouts, clock, auto progress bar. v run examples/16_interval_timers.v Snapshot 16
17_data_and_event_binding.v Data & Event Binding: Two-way state binding (bind_state), click aliases, shortcut bindings. v run examples/17_data_and_event_binding.v Snapshot 17

📘 Documentation

  • Full API Guide: See API.md for complete details on window configuration, controls, layout engine, themes, event callbacks, reactive state management (state.v), system calls (sys.v), and standard library extensions (stdlib.v).
  • Examples Guide: See examples/README.md for detailed descriptions of all example scripts.

About

simple_gg is a lightweight, beginner-friendly UI framework for building native, hardware-accelerated desktop applications in V. Built on top of V's native gg graphics module (powered by Sokol), simple_gg delivers smooth performance and uniform UI rendering across macOS, Linux, and Windows.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages