Skip to main content

button_group

Function button_group 

Source
pub fn button_group(
    id: impl Into<ElementId>,
    items: Vec<ChoiceItem>,
    selected: Option<usize>,
    on_change: impl Fn(usize, &mut Window, &mut App) + 'static,
    window: &mut Window,
    cx: &mut App,
) -> RadioGroup
Expand description

A single-choice setting rendered as content-sized segments in a shared frame. The application owns selected and updates it in on_change. Left/Right (or h/l) move the cursor; Return/Space commit the choice.