| Crates.io | windjammer-ui |
| lib.rs | windjammer-ui |
| version | 0.3.6 |
| created_at | 2025-11-28 01:43:14.000524+00 |
| updated_at | 2026-01-04 23:53:56.558634+00 |
| description | Cross-platform UI framework for Windjammer (Web, Desktop, Mobile) |
| homepage | https://github.com/jeffreyfriedman/windjammer-ui |
| repository | https://github.com/jeffreyfriedman/windjammer-ui |
| max_upload_size | |
| id | 1954675 |
| size | 1,447,516 |
Pure Windjammer UI framework - Zero HTML/CSS/JavaScript required
use windjammer_ui::*
fn main() {
let app = Container::new()
.child(Text::new("Hello, World!").size(TextSize::XLarge).bold().render())
.child(Button::new("Click Me").variant(ButtonVariant::Primary).render())
.child(Alert::success("Ready to build!").render())
.render()
println!("{}", app)
}
That's it! No HTML, no CSS, no JavaScript. Just pure Windjammer.
| Feature | Description |
|---|---|
| 🎯 Pure Windjammer | Write only .wj files - zero HTML/CSS/JS |
| 📦 55 Components | Complete UI library from buttons to chat interfaces |
| 💬 Chat Ready | Built-in ChatGPT-style message components |
| 🎨 Beautiful Styling | Production-ready designs out of the box |
| 🌙 Dark Mode | Built-in theme support |
| 🏗️ Builder Pattern | Fluent, chainable APIs |
| 🔒 Type Safe | Compile-time guarantees |
| ⚡ Zero Runtime | Compiles to native Rust |
| 📱 Responsive | Mobile-friendly layouts |
→ View Live Interactive Gallery | 49 Components, 100% Windjammer
TextText::new("Hello") |
ButtonButton::new("Click") |
InputInput::new() |
CheckboxCheckbox::new() |
SliderSlider::new() |
BadgeBadge::new("New") |
AlertAlert::success("Done!") |
// Text with styling
Text::new("Welcome").size(TextSize::XLarge).bold().render()
// Button variants
Button::new("Primary").variant(ButtonVariant::Primary).render()
Button::new("Success").variant(ButtonVariant::Success).render()
Button::new("Danger").variant(ButtonVariant::Danger).render()
// Alert types
Alert::success("Operation completed!").render()
Alert::error("Something went wrong!").render()
Alert::warning("Please review").render()
Alert::info("Did you know?").render()
| Container - Centered max-width wrapper | Flex - Flexbox layouts (row/column) |
| Grid - CSS Grid with N columns | Panel - Bordered container with header |
| Divider - Visual separator (H/V) | Spacer - Flexible spacing |
| ScrollArea - Scrollable content | SplitPanel - Resizable split view |
// Flex layout
Flex::new()
.direction(FlexDirection::Row)
.gap("16px")
.child(Button::new("Left").render())
.child(Button::new("Right").render())
.render()
// Grid layout
Grid::new()
.columns(3)
.gap("12px")
.child("<div>Item 1</div>")
.child("<div>Item 2</div>")
.child("<div>Item 3</div>")
.render()
// Panel with title
Panel::new()
.title("Settings")
.child("<p>Panel content here</p>")
.collapsible(true)
.render()
| Switch - Toggle switch | Radio - Radio button group | Select - Dropdown menu | |
| Checkbox - Boolean input | Slider - Numeric range | Input - Text field | ColorPicker - Color selector |
// Switch
Switch::new()
.label("Enable notifications")
.checked(true)
.render()
// Radio group
RadioGroup::new("size")
.option(RadioOption::new("small", "Small"))
.option(RadioOption::new("large", "Large"))
.selected("small")
.render()
// Select dropdown
Select::new()
.option(SelectOption::new("1", "Option 1"))
.option(SelectOption::new("2", "Option 2"))
.selected("1")
.render()
| Card - Content container with styling | Progress - Progress bar with variants | |
| Spinner - Loading indicator | Avatar - User profile image | Skeleton - Loading placeholder |
// Card with content
Card::new()
.title("Welcome")
.child("<p>Card content goes here</p>")
.padding("24px")
.render()
// Progress bar
Progress::new()
.value(75)
.max(100)
.variant(ProgressVariant::Success)
.show_label(true)
.render()
// Avatar
Avatar::new()
.src("user.jpg")
.alt("John Doe")
.size(AvatarSize::Large)
.render()
| ChatMessage - Message bubbles (user/assistant/system) | MessageList - Scrollable chat history |
| ChatInput - Multi-line input with send button | TypingIndicator - Animated typing dots |
| CodeBlock - Code display with copy button |
// Build a ChatGPT-style interface
MessageList::new()
.message(
ChatMessage::new("Hello!")
.role(MessageRole::User)
.timestamp("2:30 PM")
.render()
)
.message(
ChatMessage::new("Hi! How can I help you?")
.role(MessageRole::Assistant)
.render()
)
.message(TypingIndicator::new().render())
.render()
// Chat input with send button
ChatInput::new()
.placeholder("Type your message...")
.multiline(true)
.rows(3)
.render()
// Code block with copy
CodeBlock::new("fn main() { println!(\"Hello!\"); }")
.language("rust")
.show_copy_button(true)
.render()
| Navbar - Top/bottom navigation bar **NEW!** | Sidebar - Collapsible side navigation **NEW!** | HamburgerMenu - Mobile drawer menu **NEW!** |
| Tabs - Tab navigation | TabPanel - Alternative tabs | Toolbar - Action buttons bar |
| Tooltip - Hover information | Breadcrumb - Navigation trail | Dropdown - Menu dropdown |
| Menu - Navigation menu | Pagination - Page navigation |
// Navbar with brand and items
Navbar::new()
.brand("MyApp")
.item(NavbarItem::new("Home", "/"))
.item(NavbarItem::new("About", "/about"))
.sticky(true)
.render()
// Collapsible sidebar
Sidebar::new()
.item(SidebarItem::new("Dashboard").icon("📊").href("/"))
.item(SidebarItem::new("Settings").icon("⚙️").href("/settings"))
.width("250px")
.collapsed(false)
.render()
// Hamburger menu
HamburgerMenu::new()
.item(HamburgerMenuItem::new("Profile", "/profile"))
.item(HamburgerMenuItem::new("Logout", "/logout"))
.render()
// Tabs
Tabs::new()
.tab(Tab::new("overview", "Overview").active(true))
.tab(Tab::new("settings", "Settings"))
.render()
// Pagination
Pagination::new()
.current(2)
.total(10)
.render()
| Dialog - Modal popups | Toast - Notifications | Accordion - Expandable sections |
| CodeEditor - Code input | AdvancedCodeEditor - Full editor | ContextMenu - Right-click menu **NEW!** |
// Toast notification
Toast::new("Success!")
.variant(ToastVariant::Success)
.position(ToastPosition::TopRight)
.duration(3000)
.render()
// Dialog
Dialog::new()
.title("Confirm Action")
.content("<p>Are you sure?</p>")
.open(true)
.render()
// Accordion
Accordion::new()
.item(AccordionItem::new("Section 1", "<p>Content 1</p>"))
.item(AccordionItem::new("Section 2", "<p>Content 2</p>"))
.render()
// Context menu
ContextMenu::new("my-element")
.item(ContextMenuItem::new("Copy").icon("📋"))
.item(ContextMenuItem::new("Paste").icon("📄"))
.item(ContextMenuItem::new("Delete").icon("🗑️"))
.render()
| FileTree - File browser | TreeView - Generic tree | CollapsibleSection - Expandable panel |
// File tree
FileTree::new()
.node(FileNode::directory("src")
.child(FileNode::file("main.rs"))
.child(FileNode::file("lib.rs"))
)
.render()
// Tree view
TreeView::new()
.item(TreeItem::new("Root")
.child(TreeItem::new("Child 1"))
.child(TreeItem::new("Child 2"))
)
.render()
use windjammer_ui::*
fn main() {
let mut count = 0
let ui = Container::new()
.child(
Text::new(format!("Count: {}", count))
.size(TextSize::XLarge)
.render()
)
.child(
Button::new("Increment")
.variant(ButtonVariant::Primary)
.render()
)
.render()
println!("{}", ui)
}
use windjammer_ui::*
fn main() {
let dashboard = Container::new()
.max_width("1200px")
.child(
Grid::new()
.columns(3)
.gap("24px")
.child(
Card::new()
.title("Users")
.child(Text::new("1,234").size(TextSize::XLarge).render())
.render()
)
.child(
Card::new()
.title("Revenue")
.child(Text::new("$45,678").size(TextSize::XLarge).render())
.render()
)
.child(
Card::new()
.title("Orders")
.child(Text::new("567").size(TextSize::XLarge).render())
.render()
)
.render()
)
.render()
println!("{}", dashboard)
}
use windjammer_ui::*
fn main() {
let form = Card::new()
.title("Contact Form")
.child(
Flex::new()
.direction(FlexDirection::Column)
.gap("16px")
.child(
Input::new()
.placeholder("Your name")
.render()
)
.child(
Input::new()
.placeholder("Email address")
.render()
)
.child(
Button::new("Submit")
.variant(ButtonVariant::Primary)
.render()
)
.render()
)
.render()
println!("{}", form)
}
wj add windjammer-ui
<link rel="stylesheet" href="windjammer-ui.css">
use windjammer_ui::*
fn main() {
let ui = Button::new("Hello").render()
println!("{}", ui)
}
That's it! No build configuration, no webpack, no npm packages.
Button::new("Click Me")
.variant(ButtonVariant::Primary)
.size(ButtonSize::Large)
.render()
<button class="wj-button wj-button-primary wj-button-lg">
Click Me
</button>
/* Included in windjammer-ui.css */
.wj-button { padding: 10px 20px; border-radius: 6px; ... }
.wj-button-primary { background: #667eea; color: white; ... }
Developers never write the HTML or CSS! They're auto-generated from pure Windjammer code.
The gallery showcases all 40 components with:
Try it now to see:
| Traditional Approach | Windjammer UI |
|---|---|
| Write React JSX | ✅ Write pure Windjammer |
| Import 10+ npm packages | ✅ One import: std::ui |
| Configure webpack/vite | ✅ Zero config |
| Write custom CSS | ✅ Beautiful defaults |
| Debug runtime errors | ✅ Compile-time safety |
| Ship large JS bundles | ✅ Compiled to Rust/WASM |
✅ 49 / 49 Components Implemented (100%)
Basic: ████████████████████ 7/7
Layout: ████████████████████ 8/8
Forms: ████████████████████ 7/7
Data Display: ████████████████████ 5/5
Navigation: ████████████████████ 11/11
Chat: ████████████████████ 5/5 🆕
Advanced: ████████████████████ 6/6
Tree: ████████████████████ 3/3
Status: Production Ready! 🎉 New: Chat-ready with ChatGPT-style messaging components!
All components compile to native Rust:
All 40 components are written in pure Windjammer (.wj files) located in src/components_wj/.
To add a new component:
src/components_wj/mycomponent.wj./wj-build.sh to transpile to Rustsrc/components/mod.rsLicensed under either of:
at your option.
While Windjammer UI is production-ready, there are some platform-specific considerations:
features = ["web"] for web-only builds.# Web/WASM only (smallest bundle)
windjammer-ui = { version = "0.1.1", features = ["web"] }
# Desktop only (native windowing)
windjammer-ui = { version = "0.1.1", features = ["desktop"] }
# All platforms (largest bundle)
windjammer-ui = { version = "0.1.1", features = ["all-platforms"] }
Built with ❤️ in pure Windjammer
View Gallery • Read Docs • Report Issue
⭐ Star us on GitHub if you like Windjammer UI! ⭐