loader
loaderUse the global loader object to load Slint files from the file system. It exposes two stages of attributes:
- Any lookup of an attribute in the loader tries to match a file in
sys.pathwith the.slintextension. For exampleloader.my_componentlooks for a filemy_component.slintin the directories insys.path. - Any lookup in the object returned by the first stage tries to match an exported component in the loaded file, or a
struct, or enum. For example
loader.my_component.MyComponentlooks for an exported component namedMyComponentin the filemy_component.slint.
Note: The first entry in the module search path sys.path is the directory that contains the input script.
Example:
import slint# Look for a file `main.slint` in the current directory,# #load & compile it, and instantiate the exported `MainWindow` componentmain_window = slint.loader.main_window.MainWindow()main_window.show()...python
© 2026 SixtyFPS GmbH