Ring Slint is a powerful Ring library that brings the Slint declarative UI toolkit to the Ring programming language. Create stunning, high-performance native applications for desktop and mobile with a clean separation between UI design and application logic.
- High Performance: .slint files are interpreted at runtime with GPU-accelerated rendering via Skia (FemtoVG on FreeBSD).
- Cross-Platform: Build applications for Windows, macOS, Linux, FreeBSD, Android, and iOS from a single codebase.
- Declarative UI: Design your interface using Slint's intuitive
.slintmarkup language. - Two-Way Binding: Seamlessly connect Ring callbacks to Slint events and update properties dynamically.
- Rich Widget Set: Access Slint's built-in widgets with multiple themes (Fluent, Material, Cupertino, Native).
- Desktop Integration: File dialogs, message boxes, notifications, clipboard, global hotkeys, and system tray support.
- Ring: Version 1.25 or higher.
Click here for instructions on
Android
Android builds use GPU-accelerated rendering via Skia (OpenGL ES or Vulkan). Desktop-only features (file dialogs, notifications, hotkeys, system tray) are not available on Android.
Build requirements:
- Android NDK (r25 or later recommended)
- Rust with Android targets:
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android cargo-apk:cargo install cargo-apk
Build for Android:
cd src/rust_src
cargo apk build --releaseThe library is configured for min SDK 21 (Android 5.0) and targets SDK 35.
Release signing: For release builds, configure your keystore in src/rust_src/Cargo.toml under [package.metadata.android.signing.release]:
[package.metadata.android.signing.release]
path = "/path/to/your/keystore.jks"
keystore_password = "your_password"
key_alias = "your_alias"
key_password = "your_key_password"Click here for instructions on
iOS
iOS builds use GPU-accelerated rendering via Skia (Metal). Desktop-only features (file dialogs, notifications, clipboard, hotkeys, system tray) are not available on iOS.
Build requirements:
- macOS with Xcode installed
- Rust with iOS targets:
rustup target add aarch64-apple-ios aarch64-apple-ios-sim - Optional:
xcodegen(brew install xcodegen) andios-deploy(brew install ios-deploy)
Build for iOS:
cd ios/
# Simulator
./build.sh --simulator
# Device
./build.sh
# Build, install, and run on device
./build.sh --runFor more details, see the iOS Guide.
Click here for instructions on
Windows
No additional dependencies required. The library is self-contained.
Install the library using RingPM:
ringpm install ring-slint from ysdragonCreating a Slint application involves two files: a .slint file for the UI and a .ring file for the logic.
counter.slint - Define your UI:
import { Button } from "std-widgets.slint";
export component App inherits Window {
title: "Counter";
width: 300px;
height: 200px;
callback increment();
callback decrement();
in-out property <int> counter: 0;
VerticalLayout {
alignment: center;
spacing: 20px;
Text {
text: counter;
font-size: 48px;
horizontal-alignment: center;
}
HorizontalLayout {
alignment: center;
spacing: 10px;
Button { text: "-"; clicked => { decrement(); } }
Button { text: "+"; clicked => { increment(); } }
}
}
}counter.ring - Add your logic:
load "slint.ring"
nCount = 0
oApp = new SlintApp {
loadUI("counter.slint")
setCallback("increment", :onIncrement)
setCallback("decrement", :onDecrement)
show()
run()
}
func onIncrement
nCount++
oApp.set("counter", nCount)
func onDecrement
nCount--
oApp.set("counter", nCount)For more examples, see the examples/ directory.
| Document | Description |
|---|---|
| API Reference | Complete reference for all 99 SlintApp methods |
| Android Guide | Building and deploying on Android |
| iOS Guide | Building and deploying on iOS |
| Category | Methods |
|---|---|
| Core | loadUI(), loadUIString(), create(), show(), hide(), run(), quit(), window(), definition() |
| Properties | set(), setBool(), setString(), setNumber(), setColor(), setEnum(), setImage(), getProperty() |
| Callbacks | setCallback(), invoke(), callbackArg(), callbackArgsCount() |
| Timers | timerStart(), timerStartOnce(), timerStop(), timerRestart(), timerRunning(), timerSetInterval() |
| Models | modelCreate(), modelPush(), modelInsert(), modelSet(), modelGet(), modelRemove(), modelClear(), modelCount(), modelDestroy() |
| Globals | globalGet(), globalSet(), globalSetCallback(), globalInvoke() |
| Window | windowSetPosition(), windowGetPosition(), windowSetSize(), windowGetSize(), windowSetMinimized(), windowSetMaximized(), windowSetFullscreen(), windowIsMinimized(), windowIsMaximized(), windowIsFullscreen(), windowIsVisible(), windowDrag(), windowSetAlwaysOnTop(), windowSetIcon(), windowRequestRedraw(), windowScaleFactor() |
| Style | setStyle(), getStyle(), addLibraryPath(), removeLibraryPath(), clearLibraryPaths() |
| Introspection | definitionName(), definitionProperties(), definitionCallbacks(), definitionFunctions(), definitionGlobals() |
These features are not available on Android:
| Category | Methods |
|---|---|
| File Dialogs | fileOpen(), fileOpenWithFilters(), fileOpenMultiple(), fileOpenMultipleWithFilters(), fileSave(), fileSaveWithName(), fileSaveWithFilters(), folderOpen(), folderOpenMultiple() |
| Message Boxes | msgbox(), msgboxWarning(), msgboxError(), confirm(), yesno() |
| Notifications | notify(), notifyWithTimeout(), notifyWithIcon(), notifyFull() |
| Clipboard | clipboardGet(), clipboardSet(), clipboardClear() |
| Hotkeys | hotkeyRegister(), hotkeyUnregister(), hotkeyUnregisterAll(), hotkeyPoll() |
| System Tray | trayCreate(), trayCreateWithIcon(), traySetIcon(), traySetTooltip(), trayAddItem(), trayAddSeparator(), trayDestroy(), trayPoll() |
- Rust: Latest stable version with Cargo.
- Ring: Fully built Ring installation (required by
ring-lang-rsfor linking).
-
Clone the Repository:
git clone https://github.com/ysdragon/ring-slint.git cd ring-slint -
Set the
RINGEnvironment Variable:# Unix export RING=/path/to/ring # Windows (PowerShell) $env:RING = "X:\path\to\ring"
-
Build the Rust Library:
cd src/rust_src cargo build --release
The compiled library will be in src/rust_src/target/release/.
Contributions are welcome! If you have ideas for improvements or have found a bug, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.



