| Crates.io | structura |
| lib.rs | structura |
| version | 0.3.4 |
| created_at | 2025-07-12 20:19:40.689566+00 |
| updated_at | 2025-07-30 05:17:47.776332+00 |
| description | A Rust GUI Framework. |
| homepage | https://github.com/NathanLaan/structura/ |
| repository | https://github.com/NathanLaan/structura/ |
| max_upload_size | |
| id | 1749651 |
| size | 140,441 |
Structura is a Rust GUI framework created to learn how to create a GUI framework in Rust. Maybe one day it will be "OK enough" to actually use for something, but you really should not use this.
The Structura GUI framework is based on cross-platform components, but has only been tested on Linux under Wayland.
Structura is based on the following Rust libraries:
Structura is loosely designed around a Model-View-Controller (MVC) architecture.
The Structura UI components are designed around a fluent API where possible. For example:
let button1 = Button::default()
.set_text("Button 1!".to_string())
.on_click(|| {
println!("button1.on_click()");
});
The minimum viable Structura app looks like this:
use structura::app::Application;
use structura::component::button::Button;
use structura::container::panel::Panel;
fn main() {
let mut panel = Panel::new();
panel.push(Box::new(Button::default()));
let mut application = Application::new(Box::new(panel));
application.run();
}
Component: Displays output to users and/or allows users to interact. Interaction may be via mouse and/or keyboard.Container: Can hold a list of child containers or components.ContainerComponent: Composition trait of Container and Component.ComponentTheme: Defines the ComponentStyle for each Structura Component in terms of its current ComponentState.Row.Column.Panel: Holds a single Component.BorderLayout (North, West, Center, East, South).SplitPane: Vertical or Horizontal. Contains two children.Tabs.Button.ImageButton: Generalize the Button to display Text or Image?Image.TextArea.TextField: Subset of TextArea? Or create a multi_line field on TextArea.Label.ToolTip.List.Tree.Combobox.Application.ComponentTheme.ComponentStyle.ComponentState.draw_border().Component in the Application.