An open API service indexing awesome lists of open source software.

https://github.com/pisaiah/ui

My UI Widget library for V
https://github.com/pisaiah/ui

cross-platform-gui gui linux mac ui ui-library v vlang vlang-library wasm widget widget-toolkit windows

Last synced: about 2 months ago
JSON representation

My UI Widget library for V

Awesome Lists containing this project

README

        

iUI


![0.0.20](https://img.shields.io/badge/version-0.0.24-white?style=flat)
![GitHub](https://img.shields.io/badge/license-MIT-blue?style=flat)
![vlang](http://img.shields.io/badge/V-0.4.10-%236d8fc5?style=flat)

Cross-platform GUI library for V. Inspired by the syntax of Java's Swing/FX & Fluent/WinUI3 Style.

Example: *([examples/demo/](examples/demo/demo.v))*

## Example

```v
fn main() {
mut window := ui.Window.new(
title: 'My App'
width: 640
height: 480
)

// Create Button
mut btn := ui.Button.new(text: 'My Button')
btn.subscribe_event('mouse_up', on_click_event)

// Add Button to Window & Run
window.add_child(btn)
window.gg.run()
}

fn on_click_event(e &ui.MouseEvent) {
println('Button clicked!')
}
```

## Install
Install via VPM:

```
v install https://github.com/pisaiah/ui
```
then
```v
import iui as ui
```

## Components, Containers, & Layouts

| Components | Containers | Panel Layouts |
| ------------- | ----------- | ------------- |
| Button | Window | Flow Layout |
| Checkbox | Panel | Border Layout |
| Hyperlink | Tabbox | Box Layout |
| Image | Modal | Grid Layout |
| InternalFrame | Page | Card Layout |
| Label | ButtonGroup | |
| Menubar | ScrollView | |
| MenuItem | Splitview | |
| NavPaneItem | TitleGroup | |
| ProgressBar | Popup | |
| Selectbox | DesktopPane | |
| Slider | NavPane | |
| Switch | | |
| Textbox | | |
| TextField | | |
| Treeview | | |

- Components are the elements of the UI (buttons, inputs, etc).
- Containers are components that are designed to contain other components (known as children).
- Layouts define how the Panel container positions it's children.

More details about Layout: [A Visual Guide to Layout Managers - docs.oracle.com](https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html)

## Themes

Light:
- Default, Minty, Ocean, Seven.
Dark:
- Dark (with Blue/Red/Green/or RGB Accent), Seven Dark.

## Included Examples

BorderLayout DemoInternal FramesNavigation Pane





Border Layout Demo
Internal Frames
Navigation Pane

NotepadCalculatorClockVideo Player







See: Notepad
Calculator
Clock
Video Player (requires libmpv)

Mines(Tic Tac Toe)^2Snake






Code: 1-Minesweeper
Demo: Play online (via WASM)
2-Tic-Tac-Toe-Squared
Play online (WASM)
3-Snake

## Used in
- [Vide](https://github.com/pisaiah/vide)
- [Verminal](https://github.com/pisaiah/verminal)
- [vPaint](https://github.com/pisaiah/vpaint) - Demo: [https://vpaint.app](https://vpaint.app)

![image](https://github.com/user-attachments/assets/82a395ce-1c4b-4d4a-a2db-44009f3ed009)

## License
This project is licensed under MIT OR Boost.


Veasel *(v mascot)* on a Swing