Skip to main content

Module collapsible

Module collapsible 

Source
Expand description

Collapsible โ€” the low-level show/hide primitive behind Accordion.

Unlike Accordion (which owns a styled title bar), Collapsible lets you render any trigger content next to the toggle chevron and any body when open. Open state lives in egui memory keyed by the id, or pass open for controlled state.

โ“˜
sc::Collapsible::new("adv").show(
    ui,
    |ui| { ui.add(sc::Label::new("Advanced settings").strong()); },
    |ui| { ui.add(sc::Switch::new(&mut flag)); },
);

Structsยง

Collapsible