Components / SplitHandle

SplitHandle

A bar to drag that changes a size.

Example

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

Code

use ravenrs::layout::Axis;
use ravenrs::prelude::*;

fn split_handle() -> impl View {
    let height = State::new(120.0_f32);
    // The size is yours to use; the bar only changes it.
    VStack::new((
        Text::new("Drag the bar, or focus it and use the arrow keys."),
        SplitHandle::new(Axis::Vertical, height.binding()).range(80.0, 300.0).inverted(),
    ))
    .spacing(8.0)
    .align(Align::Stretch)
}

Open in the playground, with every example →

Full API of SplitHandle →