← All Workshops
MudEngine Part 5: Polished UI with dioxus-components
Step 5 / 13
Declare the components module
src/main.rs already declares both modules (mod game; mod components;) from Part 4, and src/components/mod.rs already lists your own components. When dx components add ran, it appended the library components to that mod.rs — it does not rewrite your existing entries.
Open src/components/mod.rs — it should now list every component, library and yours:
mud-engine/src/components/mod.rs
pub mod app; pub mod button; pub mod card; pub mod input; pub mod separator; pub mod world_grid;
🔍 Adding your own components
Each component you write in this part — RoomCell, DirectionPad — gets its own file in src/components/, and you append one pub mod …; line to mod.rs when you create it.
dx components add only manages the library entries. Your own modules are yours to maintain — add them by hand as you go.
Step 5 / 13