| Crates.io | mix |
| lib.rs | mix |
| version | 0.2.1 |
| created_at | 2024-02-03 21:59:14.93256+00 |
| updated_at | 2025-04-26 11:34:47.538602+00 |
| description | mix - a rust ui library cooked up in half a day! (expect extra salt) |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1125679 |
| size | 113,419 |
mix is a high-performance UI library for Rust, inspired by Makepad's architecture but with a focus on simplicity and performance. mix provides a clean, modular API for building cross-platform user interfaces without the complexity of live rendering and compiler features.
mix is organized into three main modules:
Add mix to your Cargo.toml:
[dependencies]
mix = "0.1.0"
Create a simple application:
use mix::Cx;
use mix::event::Event;
use mix::*;
struct MyApp {
window: Window,
}
impl MyApp {
fn new() -> Self {
let mut cx = Cx::new();
// Create a view with a label
let mut content = View::new(&mut cx);
content.add_child(Label::new(&mut cx, "Hello, mix!"));
// Create window with content
let window = Window::new(&mut cx, "My App")
.with_content(content);
Self { window }
}
}
impl AppMain for MyApp {
fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
self.window.handle_event(cx, event);
if let Event::Draw = event {
let mut cx2d = Cx2d::new(cx);
self.window.draw(&mut cx2d);
}
}
}
app_main!(MyApp);
Check out the examples directory for more examples:
MIT or Apache-2.0, at your option.