This release is a pre-release and may not be stable for production use.
Slint-python (Beta)
Slint is a GUI toolkit to build native user interfaces for any device,
with Python, Rust, C++, or JavaScript.
Slint-python is the Python API for desktop and embedded Linux apps.
Describe your UI in the .slint language and connect it to your Python code.
Warning Slint-python is in a beta phase of development: the APIs, while mostly stable, may be subject to further changes. Any changes will be documented in the ChangeLog.
You can track the progress of the Python integration in the python-labeled issues.
Slint Language Manual
The Slint Language Documentation covers the Slint UI description language in detail.
Prerequisites
Installation
Install Slint with uv or pip from the Python Package Index:
uv add slint
The installation uses binaries provided for macOS, Windows, and Linux for various architectures. If your target platform
isn't covered by binaries, uv automatically builds Slint from source. In that case, you need some
software development tools on your machine, as well as Rust.
Quick Start
- Create a new project with
uv init. - Add the Slint Python package to your Python project:
uv add slint - Create a file called
app-window.slint:
import { Button, VerticalBox } from "std-widgets.slint";
export component AppWindow inherits Window {
in-out property<int> counter: 42;
callback request-increase-value();
VerticalBox {
Text {
text: "Counter: \{root.counter}";
}
Button {
text: "Increase value";
clicked => {
root.request-increase-value();
}
}
}
}
- Create a file called
main.py:
import slint
# slint.loader looks in `sys.path` for `app-window.slint`.
class App(slint.loader.app_window.AppWindow):
@slint.callback
def request_increase_value(self):
self.counter = self.counter + 1
app = App()
app.run()
- Run it with
uv run main.py.
API Overview
Instantiating a Component
The following example shows how to instantiate a Slint component in Python:
app.slint
export component MainWindow inherits Window {
callback clicked <=> i-touch-area.clicked;
in property <int> counter;
width: 400px;
height: 200px;
i-touch-area := TouchArea {}
}
The exported component is exposed as a Python class. To access this class, you have two options:
-
Call
slint.load_file("app.slint"). The returned object is a namespace that provides theMainWindowclass as well as any other explicitly exported component that inheritsWindow:import slint components = slint.load_file("app.slint") main_window = components.MainWindow()
-
Use Slint's auto-loader, which lazily loads
.slintfiles fromsys.path:import slint # Look for `app.slint` in `sys.path`: main_window = slint.loader.app.MainWindow()
slint.loadersearchessys.pathfor any attribute you look up. If a directory with that name exists, the loader returns it as a loader object; subsequent attribute lookups follow the same logic.If the name matches a file with the
.slintextension, the loader loads it withload_fileand returns the namespace.If the file name contains a dash, like
app-window.slint, an attribute lookup forapp_windowtries to locateapp_window.slintand then falls back toapp-window.slint.To load your project file (
slint-project.json), look upslint_projectin its directory. The loader passes the directory toload_file, which compiles your project'smainfile with the project's settings:# Look for `ui/slint-project.json` in `sys.path`: main_window = slint.loader.ui.slint_project.MainWindow()
Note: Other
.slintfiles in that directory load without the project file, so its include paths and library paths don't apply to them.
Accessing Properties
Properties declared as out or in-out in .slint files are visible as
properties on the component instance.
main_window.counter = 42
print(main_window.counter)
Accessing Globals
You can access global singletons in Python as properties of the component instance.
For example, this Slint code declares a PrinterJobQueue singleton:
export global PrinterJobQueue {
in-out property <int> job-count;
}
Access it as a property on the component instance by its name:
print("job count:", instance.PrinterJobQueue.job_count)
Note: Global singletons are instantiated once per component. When you export multiple components to Python, each instance has its own associated global singletons.
Setting and Invoking Callbacks
Callbacks declared in .slint files are visible as callable properties on the
component instance. Call them as functions to invoke the callback, and assign a Python callable to set the callback handler.
In Slint, you define callbacks with the callback keyword and connect them to another component's callback with
the <=> syntax.
my-component.slint
export component MyComponent inherits Window {
callback clicked <=> i-touch-area.clicked;
width: 400px;
height: 200px;
i-touch-area := TouchArea {}
}
The callbacks are exposed as properties that you can call as functions:
main.py
import slint
component = slint.loader.my_component.MyComponent()
# Connect to a callback.
def clicked():
print("hello")
component.clicked = clicked
# Invoke a callback.
component.clicked()
Another way to set callbacks is to subclass the component and use the @slint.callback decorator:
import slint
class Component(slint.loader.my_component.MyComponent):
@slint.callback
def clicked(self):
print("hello")
component = Component()
If the name of your method doesn't match the name of the callback in the .slint file, pass a name argument to the
@slint.callback() decorator. Similarly, to bind a method to a callback in a global singleton, pass a global_name
argument.
Type Mappings
Each type used for properties in the Slint language translates to a specific type in Python. See the type mappings table in the Slint Python documentation for the complete list.
Arrays and Models
You can set array properties from Python by passing subclasses of
slint.Model.
Use the slint.ListModel class to construct a model from an iterable:
component.model = slint.ListModel([1, 2, 3])
component.model.append(4)
del component.model[0]
When sub-classing slint.Model, provide the following methods:
def row_count(self):
"""Return the number of rows in your model"""
def row_data(self, row):
"""Return data at specified row"""
def set_row_data(self, row, data):
"""For read-write models, store data in the given row. When done, call notify_row_changed."""
...
self.notify_row_changed(row)
When adding or inserting rows, call notify_row_added(row, count) on the superclass. Similarly, when removing rows, notify
Slint by calling notify_row_removed(row, count).
Structs
Structs that you declare and export in Slint are accessible in the namespace that's returned
when instantiating a component.
app.slint
export struct MyData {
name: string,
age: int
}
export component MainWindow inherits Window {
in-out property <MyData> data;
}
main.py
The exported MyData struct can be constructed as follows:
import slint
# Look for for `app.slint` in `sys.path`:
main_window = slint.loader.app.MainWindow()
data = slint.loader.app.MyData(name="Simon")
data.age = 10
main_window.data = data
Enums
Enums that you declare and export in Slint are accessible in the namespace that's returned
when instantiating a component. The enums are subclasses of enum.Enum.
app.slint
export enum MyOption {
Variant1,
Variant2
}
export component MainWindow inherits Window {
in-out property <MyOption> data;
}
main.py
Variants of the exported MyOption enum can be constructed as follows:
import slint
# Look for for `app.slint` in `sys.path`:
main_window = slint.loader.app.MainWindow()
value = slint.loader.app.MyOption.Variant2
main_window.data = value
Asynchronous I/O
Use Python's asyncio library to write concurrent Python code with the async/await syntax.
Slint's event loop is a full-featured asyncio event loop. While
the event loop is running, asyncio.get_running_loop() returns
a valid loop. To run an async function when starting the loop, pass a coroutine to slint.run_event_loop().
For the common use case of interacting with REST APIs, we recommend the aiohttp library.
Known Limitations
- Pipes and sub-processes are only supported on Unix-like platforms.
Type Hints
PEP 484 introduces a standard syntax for type annotations to Python, enabling static analysis for type checking, refactoring, and code completion. Popular type checkers include mypy, Pyre, and Astral's ty.
Use Slint's slint-compiler to generate .py files with type annotations for your .slint files.
They replace calls to load_file and any use of slint.loader.
- Create a new project with
uv init. - Add the Slint Python package to your Python project:
uv add slint - Create a file called
app-window.slint:
import { Button, VerticalBox } from "std-widgets.slint";
export component AppWindow inherits Window {
in-out property<int> counter: 42;
callback request-increase-value();
VerticalBox {
Text {
text: "Counter: \{root.counter}";
}
Button {
text: "Increase value";
clicked => {
root.request-increase-value();
}
}
}
}
-
Run the slint-compiler to generate
app_window.py:uvx slint-compiler -f python -o app_window.py app-window.slintIf your
slint-project.jsonsets"main": "app-window.slint", pass the project file or its directory:uvx slint-compiler -f python -o app_window.py slint-project.json. The generated module loads that project at run time, too. -
Create a file called
main.py:
import slint
import app_window
class App(app_window.AppWindow):
@slint.callback
def request_increase_value(self):
self.counter = self.counter + 1
app = App()
app.run()
- Run it with
uv run main.py.
License
Slint is open source and available under three licenses: you pick the one that fits your app.
- If your app is open source, use the GNU GPLv3, a widely used, OSI-approved open-source license. It covers any platform, including embedded devices.
- If your app is closed source and runs on desktop, mobile, or the web,
use the Royalty-free License.
It's free of charge, and only asks you to credit Slint, with the
AboutSlintwidget or the Slint badge on your website. - If your app is closed source and runs on an embedded device, buy a commercial license. See the pricing.
Your own code can stay under a permissive license such as MIT or Apache-2.0. Anyone who forks it chooses their own Slint license, so they can reuse it in a closed-source app. The Licensing FAQ covers the details.
Third-Party Licenses
For a list of the third-party licenses of all dependencies, see the separate Third-Party Licenses page.
Metadata
Release files for slint 1.19.0b1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| slint-1.19.0b1.tar.gz | 3.4 MB | With provenance | Details for slint-1.19.0b1.tar.gz |
Built distributions (wheels)
Total release size: 134.8 MB
Release files / slint-1.19.0b1.tar.gz
| Download URL | slint-1.19.0b1.tar.gz |
|---|---|
| Size | 3.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29b86cd93994d7e835fb69bbe2747d4c0acb2a45ffef25301cd74fc5669281df
|
|
BLAKE2b-256 checksum How to use checksums |
a8f83c7a37c2f95cf828a26f1d1304f6ede8f175182c719ba53690332072671a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-win_amd64.whl
| Download URL | slint-1.19.0b1-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 13.2 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7d0a56fe0b99fb99750c9fc4b0f391c516e7c22fe55320e9118339dac74b4809
|
|
BLAKE2b-256 checksum How to use checksums |
6a75a4500bfff56844b76aeeb61cd90e96d8752002d1d091d9b22f8fa0dde8ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-musllinux_1_2_x86_64.whl
| Download URL | slint-1.19.0b1-cp311-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 16.8 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0c197bdb161c291f8935c81dde2f7415a83f2a908a616d03a6dc73bdbe17fa6b
|
|
BLAKE2b-256 checksum How to use checksums |
d99ab75b2a7d663eab4a0da85ab2eed782401fdd442a17bdf4ed48cfc82aada0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-musllinux_1_2_aarch64.whl
| Download URL | slint-1.19.0b1-cp311-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 16.4 MB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a9aa8ab261096fd6bca52763847df3c1920edfcb5de8ca8e54d276dc2b0fbcde
|
|
BLAKE2b-256 checksum How to use checksums |
204630f7915808e198b0d0248eb2cb7108d6d3ca300a41df5fd028067e419857
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-manylinux_2_35_x86_64.whl
| Download URL | slint-1.19.0b1-cp311-abi3-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 16.3 MB |
| Tags | CPython 3.11 Linux glibc 2.35+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0cdc7fb331d7f032b604298a856c5675fe5023c5b973b8aaf3d716a78243ef16
|
|
BLAKE2b-256 checksum How to use checksums |
8abca269830e68b8237c95d194328d820ec6b2304d816f6bc5bc535e967266c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-manylinux_2_35_armv7l.whl
| Download URL | slint-1.19.0b1-cp311-abi3-manylinux_2_35_armv7l.whl |
|---|---|
| Size | 15.9 MB |
| Tags | CPython 3.11 Linux glibc 2.35+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
f652db50cd3ff52e761d2c5ef53f446edecc25b040b50d568da4085a764ebfaa
|
|
BLAKE2b-256 checksum How to use checksums |
7b6e43a077e88ab9ddf824280ec176134c403b4421f3d360814b4fcf44b8ea59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-manylinux_2_35_aarch64.whl
| Download URL | slint-1.19.0b1-cp311-abi3-manylinux_2_35_aarch64.whl |
|---|---|
| Size | 15.9 MB |
| Tags | CPython 3.11 Linux glibc 2.35+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d7f3af44a32186c6a33b8c2a97c3af5fdba1672eca56a48d21b2f96b79d233c1
|
|
BLAKE2b-256 checksum How to use checksums |
a3392f9aac57503f813f173dfeecab9c0d4fdebe6b284be27577c231a3cb7245
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | slint-1.19.0b1-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 12.2 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d4e074fa4744aa8fe9f4d670dc899260d240d89b8c6d328a3918412e220b632b
|
|
BLAKE2b-256 checksum How to use checksums |
d16aa532d62149cef41000c35cac06cfdd94456778ecfaf0ec0c47a6bf1ae2cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-ios_13_0_arm64_iphonesimulator.whl
| Download URL | slint-1.19.0b1-cp311-abi3-ios_13_0_arm64_iphonesimulator.whl |
|---|---|
| Size | 12.5 MB |
| Tags | CPython 3.11 abi3 iOS 13.0+ ARM64 Simulator |
|
SHA-256 checksum How to use checksums |
a122a3f0fd85bcc5a0b0221f27d0175d3e19f9aa71dc8bc3d023e32ea85bbcb5
|
|
BLAKE2b-256 checksum How to use checksums |
6a6dada1c12b4900718edd3c7c5ba4635640c2fc40ed812c27995d82505e1729
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / slint-1.19.0b1-cp311-abi3-ios_13_0_arm64_iphoneos.whl
| Download URL | slint-1.19.0b1-cp311-abi3-ios_13_0_arm64_iphoneos.whl |
|---|---|
| Size | 12.3 MB |
| Tags | CPython 3.11 abi3 iOS 13.0+ ARM64 Device |
|
SHA-256 checksum How to use checksums |
1aab37d15c5b7b9448985f8d2f630beeba353a50d889bc3b3496f775c820546c
|
|
BLAKE2b-256 checksum How to use checksums |
8953a646842b414224291fc189e3b0498f2174b2f4a5aa6df3e3b70146843c6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for slint 1.19.0b1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 10 files in this release have been uploaded with provenance metadata.
Attestation for slint-1.19.0b1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.