3 releases
| new 0.2.2 | May 14, 2026 |
|---|---|
| 0.2.1 | May 10, 2026 |
| 0.2.0 | Feb 23, 2026 |
#2043 in GUI
Used in 2 crates
1MB
16K
SLoC
Armas
UI component library for egui following shadcn/ui design patterns.
Overview
Armas is a collection of 50+ reusable UI components for egui. It includes a theme system with serializable color palettes and spacing, along with components like buttons, inputs, dialogs, menus, cards, and layouts.
The design is inspired by shadcn/ui's approach to component libraries - focused on composability and consistency rather than heavy abstraction.
Installation
Add this to your Cargo.toml:
[dependencies]
armas = "0.1.0"
egui = "0.33"
Example
use armas::prelude::*;
use egui::Context;
fn ui(ctx: &Context) {
let theme = ctx.armas_theme();
egui::CentralPanel::default().show(ctx, |ui| {
// Button with variants
Button::new("Click me")
.variant(ButtonVariant::Default)
.size(ButtonSize::Default)
.show(ui);
// Input field
let mut text = String::new();
Input::new(&mut text)
.placeholder("Enter text...")
.show(ui);
// Card layout
Card::new()
.title("Example Card")
.description("This is a card component")
.show(ui, |ui| {
ui.label("Card content goes here");
});
});
}
Components
Includes the following component categories:
Basic: Button, Input, Select, Toggle, Slider, Progress, Badge, Alert Layout: Card, Separator, Accordion, Tabs, BentoGrid, Sidebar, Table Navigation: Menu, Breadcrumbs, Pagination, TreeView, CommandPalette Overlay: Dialog, Sheet, Drawer, Tooltip
Most components support variants (default, outline, ghost, destructive) and sizes (sm, default, lg) through builder methods.
Theming
The theme system stores color palettes and spacing values in serializable structs. Themes can be loaded from JSON or constructed programmatically:
use armas::theme::{Theme, ThemeColors};
// Load theme from JSON
let theme = Theme::load_from_json("theme.json").unwrap();
// Access theme colors
let primary = theme.primary();
let background = theme.background();
// Use with egui context
ctx.set_armas_theme(theme);
Documentation
Full API documentation is available at docs.rs/armas
Related Crates
armas- Umbrella crate with feature-gated re-exportsarmas-audio- Audio/DAW UI componentsarmas-icon- Icon rendering system
License
Licensed under either of:
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Links
Dependencies
~7MB
~132K SLoC