← All Workshops

MudEngine Part 5: Polished UI with dioxus-components

Step 5 / 11

Declare the components module

The CLI places the generated components in src/components/ and creates a src/components/mod.rs that declares each submodule. To use them from src/main.rs, add this near the top of the file, after the use dioxus::prelude::*; import:

mud-engine/src/main.rs
mod components;
🔍 No #[path] needed

The CLI puts components at the standard src/components/ location and keeps mod.rs up to date as you add or remove components. Just mod components; is all you need.

Step 5 / 11