Rustycan - UI framework for Rust with focus on developer ergonomics for retained or immediate-like mode

Overview

Rustycan

WARNING: DO NOT USE YET - experimental work in progress. Expect tons of breaking changes, often.

Rustycan is a powerful UI framework for Rust, designed to make it easier than ever to create UIs and update existing UIs for games or apps. Rustycan support immediate-like and retained mode UIs. It's built to work on top of existing UI frameworks (such as egui, druid, html) to avoid reinventing things that other frameworks do well. What Rustycan adds on is easy control creation, a powerful and intuitive layout (even for immediate mode frameworks where layout is hard), and developer ergonomics.

Rustycan aims to achieve the above goals by being a part syntactic sugar on top of other frameworks except for layout which Rustycan controls on its own. This allows to remove the "lock" on a specific frameworks and pick the one that works best for the specific scenario.

TODO: add architecture UI chart

It features a variety of advanced effects, including blur, frosted glass, shaders, and animation, as well as accessibility features and the ability to easily style and extend the framework. Additionally, Rustycan supports hot reload, themes, and native controls, allowing for cross-platform development on Android, iOS, Windows, Linux, and the web. It relies on existing frameworks for rendering to achieve its goal of providing developers with an ergonomic and intuitive experience.

Rustycan: the UI framework that can

Demo

TODO

rustycan_ui! {
    Grid (
        cols={sizes=(50 2x 1x) between=40 before_first=10 after_last=20} 
        rows=1x
        children_default_spacing=(1 1 1 2) 
      
        Button.ok "Ok" (
            style=cool_style 
            override_spacing=(10 10 10 10) 
            parent.rows=(1..2) parent.cols=1
        )
        Button.cancel "Cancel" (
            style=cool_style 
            override_spacing=(1 2 3 4)
        )
        Slider.my_slider "Brush Size".brush_size (
            range=(1..100)
            value=50
            override_spacing=(_,_,1x,1x)
        )
    )
}

Centered text followed by two right-aligned buttons:

rustycan_ui! {
    VertStack (
        Label "Hello world" (before=1x after=1x) // center
        HorizStack (
            before_first=1x // right align
            between=10 

            Button "Ok"
            Button "Cancel"
        )
    )
}

Why Rustycan?

Rustycan UI aims to be a pleasure to use:

  • easy to adding controls to GUIs. Easy layout using intuitive algorithm from morphorm
  • support the "hard" scenarios like accessibility and designer preview/hot reload
  • keeping high performance, both at runtime and developer design time
  • support for native or non-native UIs

Rustycan is not locked to a specific GUI renderering framework. You can use the same UI code with Egui, HTML, and potentially more renderers. This allows easy sharing of UI code between different people or switching to a different renderer in case of need (e.g. better accessibility or theming support).

Rustycan adds high-quality layout to even to immediate mode UI frameworks where layout has historically been hard.

Why Not Rustycan?

  • it's not ready yet. Unproven framework and single developer at the moment
  • you are happy with your current UI and see no need to switch
  • no support for your specific scenario (please contribute or open issue if so!)
  • performance is not what you expected (please open issue and/or contribute, I take performance seriously)

Goals

Goal Current State
Simple to use WIP
Easy to create UIs and update existing UIs WIP
High performance WIP
Easy to style WIP
Easy to extend WIP
Hot reload WIP
Advanced effects - blur, frosted glass, shaders WIP
Animation WIP
Accessibility WIP
Supports both immediate and retained modes WIP
Themes WIP
Cross-platform on Android, iOS, Windows, Linux, Web WIP
Native controls support WIP
Contstraints to animate controls with other controls WIP

Rustycan aims to achieve the goals above by reimplementing UI syntax and layout algorithms for developer ergonomics (ease of use), while relying on existing frameworks (either low-level or other UI frameworks) for rendering. That enables me to focus on ergonomics instead of reinventing the rendering stack.

License

MIT or Apache 2

You might also like...
Ethereum (and Ethereum like) indexer using P2P message to fetch blocks and transactions

Ethereum P2P indexer This project is an indexer for Ethereum and Ethereum forks. It takes advantage of the ETH (Ethereum Wire Protocol) to fetch block

Ticketed Discreet Log Contracts (DLCs) to enable instant buy-in for wager-like contracts on Bitcoin.
Ticketed Discreet Log Contracts (DLCs) to enable instant buy-in for wager-like contracts on Bitcoin.

dlctix Ticketed Discreet Log Contracts (DLCs) to enable instant buy-in for wager-like contracts on Bitcoin. This project is part of the Backdrop Build

Authenticate the cryptographic chain-of-custody of Linux distributions (like Arch Linux and Debian) to their source code inputs

backseat-signed Authenticate the cryptographic chain-of-custody of Linux distributions (like Arch Linux and Debian) to their source code inputs. This

A simple frontend web app in the seed.rs Rust framework.

Seed Quickstart Basic Rust-only template for your new Seed app. 1. Create a new project You can use cargo generate to use this template. $ cargo gener

Implementation of Proof of Existence consensus using Substrate Framework, Frame, Pallets, RUST

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking 🚀 Getting Started Follow the steps below to get started with the Node T

Organized, flexible testing framework for Rust

Stainless Stainless is a lightweight, flexible, unopinionated testing framework. Note that stainless currently requires the nightly version of the Rus

A network application framework for Rust

This crate is deprecated! This crate is deprecated without an immediate replacement. Discussion about a successor can be found in tokio-rs/tokio#118.

Rust-Rocket framework template Demo

rocketapp Rust-Rocket framework template Demo dependencies are defined in Cargo.toml Clone as: git clone https://github.com/srikantgdev/rocketapp [op

MLIR Rust multi-level compiler framework

MLIR-RS Multi-Level Intermediate Representation framework for Rust. What Modern programming language design is moving towards multi-level lowering to

Owner
Nokola
Nokola
Aya is an eBPF library for the Rust programming language, built with a focus on developer experience and operability.

Aya API docs | Chat | Aya-Related Projects Overview eBPF is a technology that allows running user-supplied programs inside the Linux kernel. For more

null 1.5k Jan 6, 2023
Torii ⛩️ is a simple, powerful and extensible open-source Internal Developer Portal

Torii ⛩️ Torii is a simple, powerful and extensible open-source Internal Developer Portal where developers can find all the tools and services they ne

Qovery 64 Dec 17, 2023
A github rust workflows template, just want to focus on coding

rust-template A github rust workflows template, just want to focus on coding. Demo template GitHub Actions Workflow file Table of contents Features Us

null 3 Jul 23, 2023
A simple MD5 implementation with a focus on buffered reading

md5-rs A simple MD5 implementation with a focus on buffered reading, and is completely no_std. This shouldn't be used in any security-critical softwar

Magnetar 3 Mar 25, 2022
CTF like bitcoin learning, earning framework

BITCOIN CTF todo [will be added post development] How to use cargo run -- [command] possible commands Commands: new Start a new game continu

null 3 Aug 6, 2024
Glommio Messaging Framework (GMF) is a high-performance RPC system designed to work with the Glommio framework.

Glommio Messaging Framework (GMF) The GMF library is a powerful and innovative framework developed for facilitating Remote Procedure Calls (RPCs) in R

Mohsen Zainalpour 29 Jun 13, 2023
A library to help you sew up your Ethereum project with Rust and just like develop in a common backend

SewUp Secondstate EWasm Utility Program, a library helps you sew up your Ethereum project with Rust and just like development in a common backend. The

Second State 48 Dec 18, 2022
An uploader honeypot designed to look like poor website security.

HoneyUp An uploader honeypot designed to look like poor website security. Requirements Linux server NGiNX Rust toolchain (build only) Installation Bui

Chad Baxter 21 Dec 20, 2022
The fast, light, and robust client for Ethereum-like networks.

The Fastest and most Advanced Ethereum Client. » Download the latest release « Table of Contents Description Technical Overview Building 3.1 Building

OpenEthereum 6.7k Dec 24, 2022
Like a thread pool, but for signing and broadcasting transactions

ethers-signer-pool This library provides a utility built on top of the ethers crate. The purpose of the utility is to provide a pool of signers (walle

Shaurya Arora 3 Aug 14, 2023