MCPcopy Create free account
hub / github.com/DioxusLabs/dioxus-components / ComponentDemo

Function ComponentDemo

preview/src/main.rs:819–837  ·  view source on GitHub ↗
(iframe: Option<bool>, dark_mode: Option<bool>, name: String)

Source from the content-addressed store, hash-verified

817
818#[component]
819fn ComponentDemo(iframe: Option<bool>, dark_mode: Option<bool>, name: String) -> Element {
820 let route = router().current::<Route>();
821 tracing::info!("route: {route}");
822 let Some(demo) = components::DEMOS
823 .iter()
824 .find(|demo| demo.name == name)
825 .cloned()
826 else {
827 return rsx! {
828 main { class: "dx-component-demo-not-found",
829 h3 { "Component not found" }
830 p { "The requested component does not exist." }
831 }
832 };
833 };
834 rsx! {
835 ComponentHighlight { demo }
836 }
837}
838
839#[component]
840fn ComponentHighlight(demo: ComponentDemoData) -> Element {

Callers

nothing calls this directly

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected