YUI is a lightweight GUI framework designed for AI applications, built with C language and configured via JSON. It features high performance, easy extensibility, and cross-platform support.
- Lightweight & High Performance: Optimized rendering pipeline with dirty rectangle rendering
- Declarative UI: Describe interfaces using intuitive JSON configuration
- Cross Platform: Supports Windows, macOS, and Linux
- Rich Components: Built-in support for buttons, inputs, lists, grids, dialogs, and more
- Animation System: Smooth animations with various easing functions
- Theme System: Dynamic theme switching with JSON-based styling
- Multiple JS Engines: Support for QuickJS, mquickjs, and Mario JavaScript engines
- Network Support: Built-in socket and HTTP client capabilities
Clone the repository:
git clone https://github.com/evilbinary/YUI.git
cd YUIInstall required libraries:
Windows (MSYS2):
pacman -S mingw-w64-x86_64-SDL2
pacman -S mingw-w64-x86_64-SDL2_ttf
pacman -S mingw-w64-x86_64-SDL2_image
pacman -S mingw-w64-x86_64-cjson
pacman -S mingw-w64-x86_64-dlfcnmacOS:
brew install sdl2 sdl2_ttf sdl2_image cjsonLinux (Ubuntu/Debian):
sudo apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libcjson-dev# Build the project
python ya.py -b yui
# Run the application
python ya.py -r yuiCreate a main configuration file (app.json):
{
"type": "main",
"assets": "app/assets",
"font": "Roboto-Regular.ttf",
"fontSize": "16",
"source": "app/ui/main.json"
}Create your UI definition (app/ui/main.json):
{
"id": "main_window",
"type": "View",
"position": [0, 0],
"size": [800, 600],
"style": {
"bgColor": "#2C3E50"
},
"children": [
{
"id": "hello_label",
"type": "Label",
"position": [300, 250],
"size": [200, 50],
"text": "Hello, YUI!",
"style": {
"color": "#ECF0F1",
"fontSize": 24
}
}
]
}- Framework Features - Detailed feature documentation
- JSON Format Specification - Complete JSON configuration guide
- JavaScript API Reference - Full JS API documentation
- Theme System Guide - Theme management and customization
- Dialog Component - Modal and non-modal dialogs
- Select Component - Dropdown selection controls
- Layout System - Flexible layout management
- Performance Optimization - Rendering performance tips
- Glass Effect Guide - Visual effects implementation
- Transparent Support - Transparency handling
YUI follows a layered architecture design:
┌─────────────────────────────────────┐
│ Application Layer │ ← Your App Logic
├─────────────────────────────────────┤
│ JavaScript Engine │ ← QuickJS/mquickjs/Mario
├─────────────────────────────────────┤
│ Event System │ ← Input Handling
├─────────────────────────────────────┤
│ Layout Manager │ ← UI Layout Calculation
├─────────────────────────────────────┤
│ Render Pipeline │ ← Graphics Rendering
├─────────────────────────────────────┤
│ Backend Layer │ ← SDL2/Graphics API
└─────────────────────────────────────┘
Contributions are welcome! Please read our Contribution Guidelines before submitting pull requests.
This project is licensed under the GNU Lesser General Public License v2.1 (LGPL-2.1) - see the LICENSE file for details.
Key Points of LGPL-2.1:
- You can freely use, modify, and distribute this library
- If you modify the library itself, you must release your changes under LGPL-2.1
- You can link this library with proprietary software
- When distributing binaries, you must provide access to the library's source code
For commercial use inquiries, please contact the maintainers.
- SDL2 - Cross-platform development library
- cJSON - Ultralightweight JSON parser
- QuickJS - Small and embeddable JavaScript engine
Made with ❤️ for the open-source community


