Components / SegmentedControl

SegmentedControl

Row of mutually exclusive segments, like a compact tab bar.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn segmented_control() -> impl View {
    let period = State::new(1);
    SegmentedControl::new(period.binding(), ["Day", "Week", "Month"]).label("Period")
}

Open in the playground, with every example →

Full API of SegmentedControl →