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

Method toggle

preview/src/components/sidebar/component.rs:108–116  ·  view source on GitHub ↗

Toggle the sidebar open/closed state

(&self)

Source from the content-addressed store, hash-verified

106impl SidebarCtx {
107 /// Toggle the sidebar open/closed state
108 pub fn toggle(&self) {
109 if (self.is_mobile)() {
110 let current = (self.open_mobile)();
111 let mut open_mobile = self.open_mobile;
112 open_mobile.set(!current);
113 } else {
114 self.set_open.call(!self.open());
115 }
116 }
117
118 /// Set the mobile sidebar open state
119 pub fn set_open_mobile(&self, value: bool) {

Callers 1

SidebarProviderFunction · 0.80

Calls 1

openMethod · 0.80

Tested by

no test coverage detected