Skip to content

Installation

How-to Guide2 min read
Edit page

This guide gets Quoin into an existing Cargo project and explains every feature flag you can enable. Quoin supports Rust 1.88 and newer (the workspace declares rust-version = "1.88").

  • Rust stable 1.88+ (rustup update stable).
  • For the GPUI adapter on Linux: libxkbcommon-dev, libx11-dev, libxcb1-dev, libwayland-dev, and libfontconfig1-dev.
  • The other adapters (Leptos, Dioxus, Xilem, Floem) have no system-library requirements beyond Rust itself.

Enable exactly one framework feature — this choice selects the adapter compiled into your binary:

Terminal
cargo add quoin --features gpui

This is equivalent to editing Cargo.toml:

Cargo.toml
[dependencies]
quoin = { version = "0.1", features = ["gpui"] }

If you are writing a shared hook or store crate that must stay framework-free, depend on quoin-core instead of quoin. It contains the traits and portable machinery with no adapter compiled in:

Cargo.toml
[dependencies]
quoin-core = "0.1"

Consumers of your crate then pick the framework by enabling one feature on their quoin dependency and passing your hook any context that implements ReactiveContext.

Feature What it enables
gpui GPUI adapter + UCP GPUI implementation + macros; implies rsx and gpui-rsx-classes
leptos Leptos adapter + macros
dioxus Dioxus adapter + macros
xilem Xilem adapter + macros
floem Floem adapter + macros
macros component!, quoin_render!, effect!, run_app!, quoin_element! without a framework
ui Universal Component Protocol traits from quoin-ui
rsx gpui-rsx escape hatch (rsx!, #[component], …) for GPUI-only subtrees
gpui-rsx-classes Extended Tailwind engine for GPUI (full palette, more variants, dynamic class:)
testkit Re-exports quoin-testkit for headless testing
devtools Re-exports quoin-devtools for signal tracing
leptos-shadcn shadcn component backing for the Leptos emitter (requires leptos)
dioxus-shadcn shadcn component backing for the Dioxus emitter (requires dioxus)
floem-shadcn shadcn component backing for the Floem emitter (requires floem)

The full reference with dependencies between flags lives in Feature Flags.

Create a signal and read it back in a unit test using quoin-testkit — no window, no browser:

tests/integration.rs
use quoin::prelude::*;
use quoin::testkit::{TestContext, ImmediateExecutor};
#[test]
fn signal_round_trip() {
let cx = TestContext::with_executor(ImmediateExecutor);
let count = cx.create_signal(0u32);
count.set(42);
assert_eq!(count.get(), 42);
}
Terminal
cargo test

Expected output: the test passes, confirming the adapter compiled and the context works.