An experimental cross-platform UI framework in rust.

Related tags

Command-line rust gui ui
Overview

Concoct

crate Rust Documentation CI

Cross-platform UI framework in Rust with

  • Easy functional composasbles
  • Flexible state management
  • Desktop and mobile support
  • Accessibility
  • Native skia rendering

Examples

wallet example counter example

Hello World

use concoct::{composable::text, render::run, Modifier};

fn app() {
    text(Modifier::default(), "Hello World!")
}

fn main() {
    run(app)
}

Creating a composable

To create your own composable, write a function using Rust's #[track_caller] attribute macro.

#[track_caller]
fn title_text(title: String) {
    text(Modifier::default().font_size(80.dp()), title);
}

State

State is created with the state composable.

let mut tester = Tester::new(|| {
    container(Modifier::default(), || {
        let count = state(|| 0);

        text(Modifier::default(), count.get().cloned().to_string());

        *count.get().as_mut() += 1;
    })
});

for count in 0..5 {
    assert!(tester.get_text(count.to_string()).is_some());
}
You might also like...
A cross-platform implementation of Dirman in Rust.

A Directory Manager for Neorg The neorg-dirman crate is a core module which provides a basic interface for workspaces. Workspaces are the backbone of

A new pure-Rust library for cross-platform low-level access to USB devices.

nusb A new pure-Rust library for cross-platform low-level access to USB devices. Documentation Compared to rusb and libusb Pure Rust, no dependency on

A cross platform minimalistic text user interface
A cross platform minimalistic text user interface

titik Titik is a crossplatform TUI widget library with the goal of being able to interact intuitively on these widgets. It uses crossterm as the under

Alacritty - A fast, cross-platform, OpenGL terminal emulator
Alacritty - A fast, cross-platform, OpenGL terminal emulator

Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance. The supported platforms currently consist of BSD, Linux, macOS and Windows.

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features
A cross-platform graphical process/system monitor with a customizable interface and a multitude of features

A cross-platform graphical process/system monitor with a customizable interface and a multitude of features. Supports Linux, macOS, and Windows. Inspired by both gtop and gotop.

Cross-platform terminal screen clearing library

ClearScreen Cross-platform terminal screen clearing library. API documentation. Dual-licensed with Apache 2.0 and MIT. Uses Caretaker Maintainership.

Cross-platform terminal program to download IEEE journals
Cross-platform terminal program to download IEEE journals

IEEE Journal Downloader A cross-platform terminal program which tries to download every article in a specified journal and merge the documents into on

📺(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.
📺(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.

📺(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

Comments
  • Unable to compile on linux, `unresolved import winit::platform::unix`

    Unable to compile on linux, `unresolved import winit::platform::unix`

    Building from 5b318b5 on Arch Linux throws the following error:

    error[E0432]: unresolved import `winit::platform::unix`
      --> /home/gokul/.cargo/git/checkouts/glutin-0d8b72ee6b452e22/d645179/glutin-winit/src/lib.rs:29:5
       |
    29 | use winit::platform::unix;
       |     ^^^^^^^^^^^^^^^^^^^^^ no `unix` in `platform`
       |
    help: consider importing this module instead
       |
    29 | use std::os::unix;
       |     ~~~~~~~~~~~~~~
    
    error[E0432]: unresolved import `winit::platform::unix`
      --> /home/gokul/.cargo/git/checkouts/glutin-0d8b72ee6b452e22/d645179/glutin-winit/src/lib.rs:31:22
       |
    31 | use winit::platform::unix::WindowBuilderExtUnix;
       |                      ^^^^ could not find `unix` in `platform`
    

    Rust version

    $ rustc --version
    rustc 1.66.1 (90743e729 2023-01-10)
    
    opened by sudormrfbin 4
Owner
null
Experimental integration of `fedimint-client` with the Leptos web frontend framework

CAUTION: highly experimental, the Database implementation is likely horribly broken Fedimint Client built with Leptos This repo contains a proof-of-co

null 3 Aug 27, 2023
Rust-battery - Rust crate providing cross-platform information about the notebook batteries.

battery Rust crate providing cross-platform information about the notebook batteries. Table of contents Overview Supported platforms Install Examples

svartalf 326 Dec 21, 2022
Cross-platform Rust library for coloring and formatting terminal output

Coloring terminal output Documentation term-painter is a cross-platform (i.e. also non-ANSI terminals) Rust library for coloring and formatting termin

Lukas Kalbertodt 75 Jul 28, 2022
Cross platform terminal library rust

Cross-platform Terminal Manipulation Library Crossterm is a pure-rust, terminal manipulation library that makes it possible to write cross-platform te

crossterm-rs 2.1k Jan 2, 2023
Cross-platform Rust rewrite of the GNU coreutils

Cross-platform Rust rewrite of the GNU coreutils

null 13k Jan 8, 2023
A cross platform, rust implementation for the Tegra X1 bootROM exploit

Switcheroo A CLI and GUI for the RCM BootRom exploit (Fusée Gelée exploit for Nintendo Switch) Only works on unpatched Switches: https://ismyswitchpat

Ethan Budd 35 Nov 5, 2022
Cross-platform WebView library in Rust for Tauri.

Cross-platform WebView rendering library in Rust that supports all major desktop platforms like Windows, macOS, and Linux. Overview Wry connects the w

Tauri 2.2k Jan 9, 2023
Rust-based language and runtime for cross-platform app development

Pax Pax is a cross-platform rendering engine & Rust framework for interactive graphics, animations, and GUIs. Pax extends the Rust programming languag

Pax 75 Dec 19, 2022
Safe Unix shell-like parameter expansion/variable substitution via cross-platform CLI or Rust API

Safe Unix shell-like parameter expansion/variable substitution for those who need a more powerful alternative to envsubst but don't want to resort to

Isak Wertwein 4 Oct 4, 2022
A pure Rust, cross-platform soundboard app

afx This thing is my attempt at a soundboard program. afx.mp4 Why? I tried some prior art and decided that none of the existing options fit my needs.

Andrew Kvapil 11 Dec 15, 2022