A pure-Rust GUI toolkit with stateful widgets

22 releases (13 breaking)

0.13.0 Feb 28, 2023
0.12.1 Dec 22, 2022
0.11.0 Sep 5, 2022
0.10.1 Sep 7, 2021
0.0.2 Jan 24, 2019

#128 in GUI

Download history 13/week @ 2022-11-28 6/week @ 2022-12-05 63/week @ 2022-12-12 60/week @ 2022-12-19 9/week @ 2022-12-26 9/week @ 2023-01-02 38/week @ 2023-01-09 7/week @ 2023-01-16 16/week @ 2023-01-23 16/week @ 2023-01-30 29/week @ 2023-02-06 58/week @ 2023-02-13 91/week @ 2023-02-20 31/week @ 2023-02-27 10/week @ 2023-03-06 10/week @ 2023-03-13

167 downloads per month
Used in kas-gtk


22K SLoC


Test Status Crates.io kas-text Docs Minimum rustc version

KAS is a pure-Rust GUI toolkit with stateful widgets:

  • Pure, portable Rust
  • Very fast and CPU efficient
  • Flexible event handling without data races
  • Theme abstraction layer
  • Winit + WGPU shell supporting embedded accelerated content
  • More portable shells: OpenGL, CPU-rendered, integration
  • Complex text
  • OS integration: menus, fonts, IME
  • Accessibility: screen reader, translation

Animated Scalable



See the examples directory and kas-gui/7guis.


Data or widget first?

KAS attempts to blend several GUI models:

  • Like many older GUIs, there is a persistent tree of widgets with state
  • Like Elm, event handling uses messages; unlike Elm, messages may be handled anywhere in the widget tree (proceeding from leaf to root until handled)
  • Widgets have a stable identity using a path over optionally explicit components
  • Like Model-View-Controller designs, data separation is possible; unlike Elm this is not baked into the core of the design

The results:

  • Natural support for multiple windows (there is no central data model)
  • Widget trees (without MVC) are static and pre-allocated, though efficient enough that maintaining (many) thousands of not-currently-visible widgets isn't a problem
  • Support for accessibility (only navigation aspects so far)
  • MVC supports virtual scrolling (including persistent IDs for unrealised widgets)
  • MVC supports shared (Rc or Arc) data
  • MVC and stateful widget designs feel like two different architectures forced into the same UI toolkit

Crates and features

kas is a meta-package over the core (kas-core), widget library (kas-widgets), etc. See here.

At this point in time, kas-wgpu is the only windowing/rendering implementation thus kas uses this crate by default, though it is optional.

Feature flags

The kas crate enables most important features by default, excepting those requiring nightly rustc. Other crates enable fewer features by default. See Cargo.toml.

The COPYRIGHT file includes a list of contributors who claim copyright on this project. This list may be incomplete; new contributors may optionally add themselves to this list.

The KAS library is published under the terms of the Apache License, Version 2.0. You may obtain a copy of this licence from the LICENSE file or on the following webpage: https://www.apache.org/licenses/LICENSE-2.0


~781K SLoC