slint

2025-12-10 0 132

Slint is an opensource 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:

  • Scalable: Slint should support responsive UI design, allow cross-platform
    usage across operating systems and processor architectures and support
    multiple programming languages.
  • Lightweight: Slint should require minimal resources, in terms of memory
    and processing power, and yet deliver a smooth, smartphone-like user
    experience on any device.
  • Intuitive: Designers and developers should feel productive while enjoying
    the GUI design and development process. The design creation tools should be
    intuitive to use for the designers. Similarly for the developers, the APIs
    should be consistent and easy to use, no matter which programming language
    they choose.
  • Native: GUI built with Slint should match the end users\’ expectations of a
    native application irrespective of the platform – desktop, mobile, web or
    embedded system. The UI design should be compiled to machine code and provide
    flexibility that only a native application can offer: Access full operating
    system 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 the Slint 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

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

Web using WebAssembly

Printer Demo Slide Puzzle Energy Monitor Widget Gallery 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 Language 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:

  • 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)

Architecture

An application is composed of the business logic written in Rust, C++, or
JavaScript and the .slint user interface design markup, which is compiled to
native code.

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:

  • The femtovg renderer uses OpenGL ES 2.0 for rendering.
  • The skia renderer uses Skia for rendering.
  • The software renderer uses the CPU with no additional dependencies.

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:

  • A LSP Server that adds features like auto-complete and live
    preview of the .slint files to many editors.
  • It is bundled in a Visual Studio Code Extension
    available from the market place.
  • A slint-viewer tool which displays the .slint files. The
    --auto-reload argument makes it easy to preview your UI while you are
    working on it (when using the LSP preview is not possible).
  • SlintPad, an online editor to try out .slint syntax
    without installing anything (sources).
  • A Figma to Slint plugin.

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

License

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 Paid 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

  • Follow @slint_ui on X/Twitter.
  • Follow @slint@fosstodon.org on Mastodon.
  • Follow @slint-ui on LinkedIn.
  • Follow @slint.dev on Bluesky
  • Subscribe to our YouTube channel

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 info@slint.dev.

下载源码

通过命令行克隆项目:

git clone https://github.com/slint-ui/slint.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 slint https://www.zuozi.net/33603.html

nebula
上一篇: nebula
Ciphey
下一篇: Ciphey
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务