Bevy UI Builders
Before using bevy-ui-builders
commands.spawn.with_children;
// Plus 30+ more lines for hover system...
After using bevy-ui-builders
use *;
new
.style
.build;
That's it! Hover effects, styling, and interaction handling included.
Quick Start
Add to your Cargo.toml:
[]
= "0.16"
= "0.1"
Add the plugin:
use *;
use UiBuilderPlugin;
Complete Builder Catalog
1. ButtonBuilder - Styled Interactive Buttons
// Simple button
new.build;
// Styled button with size
new
.style // Primary, Secondary, Success, Danger, Warning, Ghost
.size // Small, Medium, Large, XLarge
.with_marker // Add your own marker component
.build;
// Convenience functions
primary_button.build;
danger_button.build;
ghost_button.build;
2. DialogBuilder - Modal Dialogs with Overlays
// Confirmation dialog
new
.title
.body
.danger_button
.cancel_button
.dismissible // Can't click outside to close
.z_index // Layer above other UI
.build;
// Preset dialogs
use presets;
error;
unsaved_changes;
3. TextInputBuilder - Advanced Text Inputs
// Text input with validation
new
.with_placeholder
.with_filter // Allow letters and numbers
.with_max_length
.with_focus_group // Focus management
.with_clear_button // X button to clear
.with_marker
.build;
// Numeric input
text_input
.numeric_only // Only allows 0-9
.with_value
.build;
4. FormBuilder - Complete Forms with Validation
new
.title
.field
.field
.field
.field
.validation
.validation
.validation
.validation
.submit_button
.cancel_button
.build;
5. SliderBuilder - Value Sliders with Formatting
// Percentage slider
new
.width
.with_label // Shows "50%"
.with_marker
.build;
// Custom format
slider
.with_label
.build;
6. ProgressBarBuilder - Progress Indicators
// Basic progress bar
new // 75% complete
.style
.with_label // Shows "75%"
.animated // Smooth transitions
.build;
// Custom styled
progress
.fill_color
.track_color
.with_label_text
.build;
7. PanelBuilder - Flexible Container Panels
// Card panel with title
new
.style
.width
.padding
.with_title
.build_with_children;
// Transparent overlay panel
panel
.style
.position_type
.build;
8. LabelBuilder - Consistent Text Labels
// Styled labels
new
.style // Title, Heading, Body, Caption
.text_align
.margin
.build;
// Status labels
label
.style // Error, Success, Warning, Muted
.build;
9. SeparatorBuilder - Visual Dividers
// Horizontal separator
new
.style
.margin
.build;
// Vertical divider
separator_vertical
.style
.length
.build;
Cleanup
Generic cleanup system:
// Before: 15 lines of cleanup per UI system
// After: One line, works for ANY component!
app.add_systems;
Complete Example
use *;
use *;
;
;
Feature Flags
Control which builders are included:
# Include everything (default)
= "0.1"
# Or pick specific builders
= { = "0.1", = false, = ["button", "dialog"] }
Available features:
button- ButtonBuilderdialog- DialogBuildertext_input- TextInputBuilderform- FormBuilderslider- SliderBuilderprogress- ProgressBarBuilderpanel- PanelBuilderlabel- LabelBuilderseparator- SeparatorBuilder
Why Choose bevy-ui-builders?
We Fill The Gap
| Crate | Problem |
|---|---|
bevy_ui_builder |
Too basic, no text inputs or forms |
sickle_ui |
Complex macro system, steep learning curve |
bevy_dioxus |
Requires React/web knowledge |
bevy_egui |
Immediate mode, not native Bevy |
| bevy-ui-builders | Just right! Simple, powerful, pure Bevy |
Unique Features
- Automatic cleanup system - Generic
despawn_ui_entities<T> - Consistent styling - Centralized colors and dimensions
- Rich text inputs - Filtering, validation, focus management
- Type-safe markers - Add your own components to any builder
- Gateway architecture - Clean module boundaries
Bevy Version Support
| bevy-ui-builders | Bevy |
|---|---|
| 0.1 | 0.16 |
License
Dual-licensed under either:
- MIT license (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
at your option.
Contributing
Contributions welcome! Please check CONTRIBUTING.md for development setup, coding standards, and how to submit pull requests.
Credits
Created by Noah Sabaj, the creator of bevy-plugin-builder, and bevy-test-suite.
Bottom Line
// From 45 lines to 3. That's the power of builders.
new
.style
.build;