slint README

The project's README from github.com/slint-ui/slint. As one markdown file: README.md.

Slint Slint

Build Status REUSE status Discussions

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.

Why Slint?

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

Examples

Embedded

RaspberryPi STM32 RP2040
Video of Slint on Raspberry Pi Video of Slint on STM32 Video of Slint on RP2040

Desktop

Windows macOS Linux
Screenshot of the Gallery on Windows Screenshot of the Gallery on macOS Screenshot of the Gallery on Linux

Web using WebAssembly

Printer Demo Slide Puzzle Energy Monitor Widget Gallery Weather demo
Screenshot of the Printer Demo Screenshot of the Slide Puzzle Screenshot of the Energy Monitor Demo Screenshot of the Gallery Demo Screenshot of the weather Demo

More examples and demos in the examples folder

Get Started

Hello World

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;
    }
}

Documentation

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:

Architecture

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.

Architecture Overview

Compiler

The .slint files are compiled ahead of time. The expressions in the .slint are pure functions that the compiler can optimize. For example, the compiler could choose to "inline" properties and remove those that are constant or unchanged.

The compiler uses the typical compiler phases of lexing, parsing, optimization, and finally code generation. It provides different back-ends for code generation in the target language. The C++ code generator produces a C++ header file, the Rust generator produces Rust code, and so on. An interpreter for dynamic languages is also included.

Runtime

The runtime library consists of an engine that supports properties declared in the .slint language. Components with their elements, items, and properties are laid out in a single memory region, to reduce memory allocations.

Rendering backends and styles are configurable at compile time:

NOTE: When Qt is installed on the system, the qt style becomes available, using Qt's QStyle to achieve native looking widgets.

Tooling

We have a few tools to help with the development of .slint files:

Please check our Editors README for tips on how to configure your favorite editor to work well with Slint.

License

See LICENSE.md for the licensing terms of the whole repository, including documentation and examples.

You can use Slint under any of the following licenses, at your choice:

  1. Build proprietary desktop, mobile, or web applications for free with the Royalty-free License,
  2. Build open source embedded, desktop, mobile, or web applications for free with the GNU GPLv3,
  3. Build proprietary embedded, desktop, mobile, or web applications with the Commercial license.

See the Slint licensing options on the website and the Licensing FAQ.

Contributions

We welcome your contributions: in the form of code, bug reports or feedback. For contribution guidelines see CONTRIBUTING.md.

Frequently Asked Questions

Please see our separate FAQ.

About us (SixtyFPS GmbH)

We are passionate about software - API design, cross-platform software development and user interface components. Our aim is to make developing user interfaces fun for everyone: from Python, JavaScript, C++, or Rust developers all the way to UI/UX designers. We believe that software grows organically and keeping it open source is the best way to sustain that growth. Our team members are located remotely in Germany, Finland, and US.

Stay up to date

Contact us

Feel free to join Github discussions for general chat or questions. Use Github issues to report public suggestions or bugs.

We chat in our Mattermost instance where you are welcome to listen in or ask your questions.

You can of course also contact us privately via email to [email protected].

slint (slint-ui/slint)

Searching Database…

24.2K ·GitHub
Что это такое?Slint — это открытый декларативный инструмент для создания GUI, с помощью которого строятся нативные пользовательские интерфейсы для встраиваемых систем, настольных компьютеров, мобильных устройств и веба. Бизнес-логику можно писать на Rust, C++, JavaScript или Python.
Это UI-фреймворк или язык разметки с набором компиляторов?И то, и другое: интерфейсы вы пишете на декларативном языке разметки .slint, а компилятор, работающий заранее (ahead-of-time), переводит их в нативный код (заголовочный файл C++, код Rust и т. д.), который вы подключаете к своей бизнес-логике.
Как начать создавать интерфейс на Slint?Напишите интерфейс в файле .slint, а затем подключите его к выбранному языку, используя шаблоны для начала работы и документацию в папке api (Rust, C++, JavaScript/Node или Python).
Какие языки и инструменты нужны для работы со Slint?Нужен один из поддерживаемых языков (Rust, C++, JavaScript/Node или Python) для управления логикой, а также компилятор и среда выполнения Slint. Qt нужен только по желанию, если вы хотите виджеты в нативном виде через стиль qt.
Можно ли уже использовать привязки JavaScript и Python в промышленной эксплуатации?API для JavaScript/NodeJS и для Python прямо помечены как Beta, поэтому стоит ожидать шероховатостей по сравнению с более зрелыми API для Rust и C++.
Slint подходит только для настольных приложений или и для встраиваемых устройств тоже?Он рассчитан на настольные системы (Windows, macOS, Linux), встраиваемое оборудование (Raspberry Pi, STM32, RP2040), мобильные устройства и веб через WebAssembly. Для устройств с ограниченными ресурсами предусмотрена легковесная среда выполнения.
На каких платформах показывают приложения на Slint?В README Slint показан на встраиваемых платах Raspberry Pi, STM32 и RP2040, как нативные настольные приложения для Windows/macOS/Linux и в браузере через демо на WebAssembly.
Какие есть варианты лицензирования Slint?Можно выбрать бесплатную лицензию Royalty-free для проприетарных приложений, GNU GPLv3 для проектов с открытым исходным кодом или платную коммерческую лицензию для проприетарного использования за пределами условий бесплатной версии.
Нужна ли для отрисовки видеокарта (GPU)?Нет. Slint поддерживает несколько бэкендов отрисовки: femtovg и Skia используют ускорение на GPU (OpenGL ES 2.0 / Skia), а программный рендерер работает только на CPU и не требует дополнительных зависимостей.
Какие инструменты Slint предоставляет для разработки интерфейсов?В комплекте есть LSP-сервер с автодополнением и живым предпросмотром (поставляется как расширение для VS Code), инструмент slint-viewer с автоперезагрузкой, онлайн-редактор SlintPad и плагин Figma-to-Slint для импорта дизайнов.
Какие бэкенды отрисовки поддерживает Slint?Slint предлагает рендерер femtovg (OpenGL ES 2.0), рендерер Skia и программный рендерер, который работает только на CPU. Если установлен Qt, для виджетов в нативном виде можно также использовать стиль qt.
Можно ли попробовать Slint без установки?Да, SlintPad — это онлайн-редактор, в котором можно экспериментировать с синтаксисом .slint прямо в браузере.
Creator
slint-ui
Size
100.2 MB
Stars
24.2K
Age
6y
Commits · 90 Days