Slint is an open-source declarative GUI toolkit to build native user interfaces for Rust, C++, JavaScript, or Python apps.
翻译准备中
正在加载完整 README。
查看完整 README ↗
Slint is an open-source declarative GUI toolkit to build native user interfaces for any device.
Write your UI in .slint, a simple markup language, and connect it to business logic written in Rust, C++, JavaScript, or Python.
Slint scales from desktop apps to mobile apps on Android and iOS,
and down to embedded Linux and microcontrollers such as STM32, ESP32, and RP2040.
The name Slint is derived from our design goals:
Beyond the design goals, here’s what makes Slint stand out:
See what others have built: #MadeWithSlint
| RaspberryPi | STM32 | RP2040 |
|---|---|---|
| Video of Slint on Raspberry Pi | Video of Slint on STM32 | Video of Slint on RP2040 |
| Windows | macOS | Linux |
|---|---|---|
| Printer Demo | Slide Puzzle | Energy Monitor | Widget Gallery | Weather demo |
|---|---|---|---|---|
More examples and demos in the examples folder
The UI is defined in a Domain Specific Language that is declarative, easy to use, intuitive, and provides a powerful way to describe graphical elements, their placement, their hierarchy, property bindings, and the flow of data through the different states.
Here's the obligatory "Hello World":
export component HelloWorld inherits Window {
width: 400px;
height: 400px;
Text {
y: parent.width / 2;
x: parent.x + 200px;
text: "Hello, world";
color: blue;
}
}
For more details, check out the Slint Documentation.
The examples folder contains examples and demos, showing how to use the Slint markup language and how to interact with a Slint user interface from supported programming languages.
The docs folder contains a lot more information, including
build instructions, and
internal developer docs.
Refer to the README of each language directory in the api folder:
An application is composed of the business logic written in Rust, C++, Python, or
JavaScript and the .slint user interface design markup, which is compiled to
native code.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗