Skip to content

load_file

load_file(path: str | os.PathLike[Any] | pathlib.Path, quiet: bool = False, style: Optional[str] = None, include_paths: Optional[List[os.PathLike[Any] | pathlib.Path]] = None, library_paths: Optional[Dict[str, os.PathLike[Any] | pathlib.Path]] = None, translation_domain: Optional[str] = None) -> types.SimpleNamespace

This function is the low-level entry point into Slint for instantiating components. It loads the .slint file at the specified path and returns a namespace with all exported components as Python classes, as well as enums, and structs.

  • quiet: Set to true to prevent any warnings during compilation from being printed to stderr.
  • style: Specify a widget style.
  • include_paths: Additional include paths used to look up .slint files imported from other .slint files.
  • library_paths: A dictionary that maps library names to their location in the file system. This is then used to look up library imports, such as import { MyButton } from "@mylibrary";.
  • translation_domain: The domain to use for looking up the catalogue run-time translations. This must match the translation domain used when extracting translations with slint-tr-extractor.

© 2026 SixtyFPS GmbH