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

Function DarkModeToggle

preview/src/theme.rs:90–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88
89#[component]
90pub fn DarkModeToggle() -> Element {
91 rsx! {
92 button {
93 class: "dx-dark-mode-toggle dx-dark-mode-only",
94 onclick: move |_| set_theme(false),
95 r#type: "button",
96 aria_label: "Enable light mode",
97 DarkModeIcon {}
98 }
99 button {
100 class: "dx-dark-mode-toggle dx-light-mode-only",
101 onclick: move |_| set_theme(true),
102 r#type: "button",
103 aria_label: "Enable dark mode",
104 LightModeIcon {}
105 }
106 }
107}
108
109#[component]
110fn DarkModeIcon() -> Element {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected