use-ui is a RustUse facade workspace for portable, framework-neutral user interface primitives. It models stable UI vocabulary such as design tokens, themes, layout, spacing, breakpoints, viewports, component metadata, interaction states, focus metadata, affordances, motion semantics, and layer ordering.
RustUse is a collection of composable sets of primitive Rust utility crates. This workspace follows that shape: focused crates stay small and dependency-light, and the top-level use-ui crate primarily re-exports the focused crates behind feature flags.
use-ui is not:
- a rendering framework
- a component framework
- a CSS framework
- a web-only crate
- a wrapper around
React,Vue,Yew,Leptos,Dioxus,egui,Iced,Tauri, or another UI runtime - a design-token parser
- an accessibility audit engine
- an animation runtime
Framework-neutral UI primitives are useful when the same UI vocabulary needs to move across boundaries. A design-system tool, docs generator, schema format, Rust web framework, desktop tool, TUI, code generator, test utility, or AI-generated UI planner can share names and metadata without taking a dependency on a renderer.
The crates in this workspace describe UI intent and structure. They do not render pixels, generate CSS, bind to a DOM, or implement keyboard behavior.
| Crate | Purpose | Status |
|---|---|---|
use-ui |
Feature-gated facade over focused UI primitive crates | initial |
use-design-token |
Design-token names, paths, categories, values, references | initial |
use-theme |
Theme modes, names, variants, and semantic roles | initial |
use-layout |
Layout direction, axis, alignment, justification, and flow | initial |
use-spacing |
Spacing scale, named spacing, insets, gaps, margins | initial |
use-breakpoint |
Breakpoint names, ranges, and breakpoint sets | initial |
use-viewport |
Viewport size, orientation, density, class, and scale | initial |
use-ui-component |
Component identity, parts, slots, variants, sizes, roles | initial |
use-interaction |
Interaction state, kind, intent, and helper methods | initial |
use-focus |
Focus state, target, order, visibility, index, scope | initial |
use-affordance |
Affordance vocabulary and affordance-set membership | initial |
use-ui-motion |
Motion duration, curve, preference, transition semantics | initial |
use-layer |
UI layer roles, z-index values, stacks, and ordering | initial |
# #[cfg(feature = "full")]
# {
use use_ui::{
affordance::Affordance,
interaction::InteractionState,
layer::LayerRole,
layout::{Alignment, Direction},
theme::ThemeMode,
};
let state = InteractionState::Focused;
let direction = Direction::Vertical;
let alignment = Alignment::Center;
let layer = LayerRole::Modal;
let theme = ThemeMode::Dark;
let affordance = Affordance::Clickable;
assert!(state.is_focus_visible_candidate());
assert_eq!(direction, Direction::Vertical);
assert_eq!(alignment, Alignment::Center);
assert!(layer.sits_above(LayerRole::Popover));
assert_eq!(theme, ThemeMode::Dark);
assert_eq!(affordance, Affordance::Clickable);
# }The facade crate enables all focused crates by default through full. Disable default features when you want a narrow facade surface.
[dependencies]
use-ui = { version = "0.1.0", default-features = false, features = ["theme", "layout", "interaction"] }This is an experimental v0.1.0 workspace. APIs are intentionally small, explicit, and primitive while the RustUse UI vocabulary settles. The release line should stay below 0.3.0 until production readiness is intentional.
cargo fmt --all -- --check
cargo check --workspace --all-features
cargo check --workspace --all-features --examples
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-features
cargo test --workspace --no-default-features
cargo doc --workspace --all-features --no-depsLicensed under either of the following, at your option:
- Apache License, Version 2.0
- MIT license