pub struct Switch { /* private fields */ }Expand description
Animated switch component (shadcn/ui Switch)
§Example
use armas_basic::components::Switch;
let mut checked = false;
let mut switch = Switch::new().label("Dark mode");
switch.show(ui, &mut checked);Implementations§
Source§impl Switch
impl Switch
Sourcepub const fn size(self, size: SwitchSize) -> Self
pub const fn size(self, size: SwitchSize) -> Self
Set the size
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set a description
Sourcepub fn show(&mut self, ui: &mut Ui, checked: &mut bool) -> SwitchResponse
pub fn show(&mut self, ui: &mut Ui, checked: &mut bool) -> SwitchResponse
Show the switch and return whether it changed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Switch
impl RefUnwindSafe for Switch
impl Send for Switch
impl Sync for Switch
impl Unpin for Switch
impl UnsafeUnpin for Switch
impl UnwindSafe for Switch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more