Skip to main content

toggle_group_multi

Function toggle_group_multi 

Source
pub fn toggle_group_multi<I, V, L>(
    key: impl Into<String>,
    selected: &HashSet<String>,
    options: I,
) -> El
where I: IntoIterator<Item = (V, L)>, V: Display, L: Into<String>,
Expand description

A row of independent on/off toggle items — flip each independently. selected is the set of currently-pressed values (compared as strings, formatted from each option’s value). options is an iterable of (value, label) pairs.

Per-item routed keys are {key}:toggle:{value}. Apps fold those back into their set with apply_event_multi.

Use this for filter chips, formatting toolbars (B / I / U), and anything where multiple options coexist.