- Notifications
You must be signed in to change notification settings - Fork705
Slint is an open-source declarative GUI toolkit to build native user interfaces for Rust, C++, JavaScript, or Python apps.
License
slint-ui/slint
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Slint is an open-source declarative GUI toolkit for building native user interfaces for embedded systems, desktops, and mobile platforms.
Write your UI once in.slint
, a simple markup language. Connect it to business logic written in Rust, C++, JavaScript, or Python.
The nameSlint is derived from our design goals:
- Scalable: Slint should support responsive UI design, allow cross-platformusage across operating systems and processor architectures and supportmultiple programming languages.
- Lightweight: Slint should require minimal resources, in terms of memoryand processing power, and yet deliver a smooth, smartphone-like userexperience on any device.
- Intuitive: Designers and developers should feel productive while enjoyingthe GUI design and development process. The design creation tools should beintuitive to use for the designers. Similarly for the developers, the APIsshould be consistent and easy to use, no matter which programming languagethey choose.
- Native: GUI built with Slint should match the end users' expectations of anative application irrespective of the platform - desktop, mobile, web orembedded system. The UI design should be compiled to machine code and provideflexibility that only a native application can offer: Access full operatingsystem APIs, utilize all CPU and GPU cores, connect to any peripheral.
Beyond the design goals, here’s what makes Slint stand out:
- Independent UI Design: Use a declarative language similar to separate your UI from business logic. Designers can work in parallel with developers.
- Tooling: Iterate quickly with our Live Preview & editor integrations. Integrate from Figma with theSlint To Figma plugin.
- Stable APIs: Slint follows a stable 1.x API. We evolve carefully without breaking your code.
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 theexamples 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, theirplacement, their hierarchy, property bindings, and the flow of data through thedifferent states.
Here's the obligatory "Hello World":
exportcomponentHelloWorldinheritsWindow {width:400px;height:400px;Text {y:parent.width /2;x:parent.x +200px;text:"Hello, world";color: blue; }}
For more details, check out theSlint Language Documentation.
Theexamples folder contains examples and demos, showing how touse the Slint markup language and how to interact with a Slint user interfacefrom supported programming languages.
Thedocs
folder contains a lot more information, includingbuild instructions, andinternal developer docs.
Refer to the README of each language directory in theapi
folder:
- C++ (Documentation |Getting Started Template)
- Rust
(Documentation |Tutorial Video |Getting Started Template)
- JavaScript/NodeJS (Beta)
(Documentation |Getting Started Template)
- Python (Beta)
(Documentation |Getting Started Template)
An application is composed of the business logic written in Rust, C++, orJavaScript and the.slint
user interface design markup, which is compiled tonative code.
The.slint
files are compiled ahead of time. The expressions in the.slint
are pure functions that the compiler can optimize. For example, the compilercould choose to "inline" properties and remove those that are constant orunchanged.
The compiler uses the typical compiler phases of lexing, parsing, optimization,and finally code generation. It provides different back-ends for code generationin the target language. The C++ code generator produces a C++ header file, theRust generator produces Rust code, and so on. An interpreter for dynamiclanguages is also included.
The runtime library consists of an engine that supports properties declared inthe.slint
language. Components with their elements, items, and properties arelaid out in a single memory region, to reduce memory allocations.
Rendering backends and styles are configurable at compile time:
- The
femtovg
renderer uses OpenGL ES 2.0 for rendering. - The
skia
renderer usesSkia for rendering. - The
software
renderer uses the CPU with no additional dependencies.
NOTE: When Qt is installed on the system, theqt
style becomes available,using Qt's QStyle to achieve native looking widgets.
We have a few tools to help with the development of .slint files:
- ALSP Server that adds features like auto-complete and livepreview of the .slint files to many editors.
- It is bundled in aVisual Studio Code Extensionavailable from the market place.
- Aslint-viewer tool which displays the .slint files. The
--auto-reload
argument makes it easy to preview your UI while you areworking on it (when using the LSP preview is not possible). - SlintPad, an online editor to try out .slint syntaxwithout installing anything (sources).
- AFigma to Slint plugin.
Please check ourEditors README for tips on how toconfigure your favorite editor to work well with Slint.
You can use Slint underany of the following licenses, at your choice:
- Build proprietary desktop, mobile, or web applications for free with theRoyalty-free License,
- Build open source embedded, desktop, mobile, or web applications for free with theGNU GPLv3,
- Build proprietary embedded, desktop, mobile, or web applications with thePaid license.
See theSlint licensing options on the website and theLicensing FAQ.
We welcome your contributions: in the form of code, bug reports or feedback.For contribution guidelines seeCONTRIBUTING.md.
Please see our separateFAQ.
We are passionate about software - API design, cross-platform softwaredevelopment and user interface components. Our aim is to make developing userinterfaces fun for everyone: from Python, JavaScript, C++, or Rust developers all theway to UI/UX designers. We believe that software grows organically and keepingit open source is the best way to sustain that growth. Our team members arelocated remotely in Germany, Finland, and US.
- Follow@slint_ui on X/Twitter.
- Follow@slint@fosstodon.org on Mastodon.
- Follow@slint-ui on LinkedIn.
- Follow@slint.dev on Bluesky
- Subscribe to ourYouTube channel
Feel free to joinGithub discussionsfor general chat or questions. UseGithub issuesto report public suggestions or bugs.
We chat inour Mattermost instance where you arewelcome to listen in or ask your questions.
You can of course also contact us privately via email toinfo@slint.dev.
About
Slint is an open-source declarative GUI toolkit to build native user interfaces for Rust, C++, JavaScript, or Python apps.
Topics
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.