use ui::multi_select::{self, MultiSelect, MultiSelectEvent};
multi_select::init(cx); // once, at startup, alongside input::init
let labels = cx.new(|cx| MultiSelect::new(choices, cx).with_create(normalize).with_manage());
cx.subscribe(&labels, |view, picker, event, cx| match event {
MultiSelectEvent::Toggled { name, on } => { /* apply, then set_choices */ }
MultiSelectEvent::Dismissed => { /* close the popover */ }
_ => {}
})
.detach();- The picker is the popover's body: mount it under your trigger through a
popoveranchored layer, and callresetas it opens. - Every event is a request. The picker paints what
set_choiceslast handed it, so answer each one. - Delete is reported unconfirmed; confirm it yourself if you need to.