{"id":15586473,"url":"https://github.com/fwcd/nuit","last_synced_at":"2025-09-02T20:42:27.223Z","repository":{"id":185910352,"uuid":"615903858","full_name":"fwcd/nuit","owner":"fwcd","description":"Declarative cross-platform UI framework for Rust that uses native controls","archived":false,"fork":false,"pushed_at":"2024-09-09T16:59:08.000Z","size":830,"stargazers_count":63,"open_issues_count":17,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-22T22:22:31.984Z","etag":null,"topics":["gui","rust","swift","swiftui","ui"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fwcd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-19T02:29:10.000Z","updated_at":"2025-03-16T11:11:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"acafe92e-9ab9-4e98-8ee0-225ed25be4ff","html_url":"https://github.com/fwcd/nuit","commit_stats":null,"previous_names":["fwcd/nuit"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fnuit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fnuit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fnuit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fnuit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwcd","download_url":"https://codeload.github.com/fwcd/nuit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252524194,"owners_count":21762048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gui","rust","swift","swiftui","ui"],"created_at":"2024-10-02T21:22:49.087Z","updated_at":"2025-05-05T15:33:51.624Z","avatar_url":"https://github.com/fwcd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nuit\n\n[![Build](https://github.com/fwcd/nuit/actions/workflows/build.yml/badge.svg)](https://github.com/fwcd/nuit/actions/workflows/build.yml)\n\nA declarative, cross-platform UI framework for Rust that uses native controls.\n\n| Crate | Description | Version | Docs |\n| - | - | - | - |\n| [nuit](./nuit) | Umbrella crate for the framework | [![crates.io](https://img.shields.io/crates/v/nuit)](https://crates.io/crates/nuit) | [![docs.rs](https://img.shields.io/docsrs/nuit)](https://docs.rs/nuit) |\n| [nuit-bridge-adwaita](./nuit-bridge-adwaita) | Adwaita backend (Linux, macOS) | [![crates.io](https://img.shields.io/crates/v/nuit-bridge-adwaita)](https://crates.io/crates/nuit-bridge-adwaita) | [![docs.rs](https://img.shields.io/docsrs/nuit-bridge-adwaita)](https://docs.rs/nuit-bridge-adwaita) |\n| [nuit-bridge-swiftui](./nuit-bridge-swiftui) | SwiftUI backend (macOS, iOS) | [![crates.io](https://img.shields.io/crates/v/nuit-bridge-swiftui)](https://crates.io/crates/nuit-bridge-swiftui) | [![docs.rs](https://img.shields.io/docsrs/nuit-bridge-swiftui)](https://docs.rs/nuit-bridge-swiftui) |\n| [nuit-core](./nuit-core) | Core structures and traits | [![crates.io](https://img.shields.io/crates/v/nuit-core)](https://crates.io/crates/nuit-core) | [![docs.rs](https://img.shields.io/docsrs/nuit-core)](https://docs.rs/nuit-core) |\n| [nuit-derive](./nuit-derive) | Derive macros | [![crates.io](https://img.shields.io/crates/v/nuit-derive)](https://crates.io/crates/nuit-derive) | [![docs.rs](https://img.shields.io/docsrs/nuit-derive)](https://docs.rs/nuit-derive) |\n\n## About the Project\n\nThe API takes inspiration from contemporary reactive frameworks like SwiftUI, Xilem and React. A central design goal is to avoid using too much macro magic and instead heavily leverage associated types, traits and generics.\n\nA simple hello world program in Nuit takes only a single line:\n\n```rust\nnuit::run_app(Text::new(\"Hello world!\"));\n```\n\nFor a more elaborate example, check out [the section below](#example).\n\n\u003e [!IMPORTANT]\n\u003e Nuit is still experimental with a rapidly evolving API. As such, treat this library as a sandbox rather than as a finished product, especially if you intend to write an app with it.\n\u003e \n\u003e While the SwiftUI backend can be considered the reference implementation of the Nuit API, the Adwaita backend is still in early development and does not cover the full API surface yet.\n\u003e \n\u003e The library also requires a nightly Rust toolchain due to its use of a number of unstable compiler features:\n\u003e\n\u003e - [impl Trait in type aliases](https://github.com/rust-lang/rust/issues/63063)\n\u003e - [associated type defaults](https://github.com/rust-lang/rust/issues/29661)\n\u003e - [macro metavariable expressions](https://github.com/rust-lang/rust/issues/83527)\n\u003e - [`let` chains](https://github.com/rust-lang/rust/issues/53667)\n\u003e - [reentrant locks](https://github.com/rust-lang/rust/issues/121440)\n\u003e\n\u003e With `rustup` this can be configured conveniently on a per-directory basis `rustup override set nightly` or, as in this repository, automatically with a [`rust-toolchain.toml`](rust-toolchain.toml).\n\n## Example\n\n```rust\nuse nuit::{prelude::*, Button, Text, VStack};\n\n#[derive(Bind, Default)]\nstruct CounterView {\n    count: State\u003ci32\u003e,\n}\n\nimpl View for CounterView {\n    type Body = impl View;\n\n    fn body(\u0026self) -\u003e Self::Body {\n        let count = self.count.clone();\n        VStack::from((\n            Text::new(format!(\"Count: {}\", count.get())),\n            Button::with_text(\"Increment\", move || {\n                count.set(count.get() + 1);\n            })\n        ))\n    }\n}\n\nfn main() {\n    nuit::run_app(CounterView::default());\n}\n```\n\nRunning this example with\n\n```sh\ncargo run --example counter\n```\n\nwill launch the app with the platform-specific default backend, e.g. SwiftUI on macOS:\n\n\u003cimg src=\"screenshots/counter-swiftui.png\" height=\"300\"\u003e\n\nUsing the Adwaita/GTK4 backend the app looks as follows:\n\n\u003cimg src=\"screenshots/counter-adwaita.png\" height=\"300\"\u003e\n\n\u003e [!TIP]\n\u003e On platforms that support multiple backends (currently only macOS) you can explicitly choose a backend via the `NUIT_BACKEND` environment variable:\n\u003e\n\u003e ```sh\n\u003e NUIT_BACKEND=adwaita cargo run --example counter\n\u003e ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fnuit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwcd%2Fnuit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fnuit/lists"}