Fusuma

Components / Components

split_view

Two panes side by side with a draggable bar between them: permille of the width goes to left (held between 50 and 950, so neither pane can be dragged shut).

Try it

This is the Pickers page of the gallery, running in your browser: split_view is on it, and it is the real widget. Press Run, then use it.

Live: Pickers, where split_view is usedOpen full size

Also on this pagecalendartime_pickeraccordionselecttree_item

Two panes side by side with a draggable bar between them: permille of the width goes to left (held between 50 and 950, so neither pane can be dragged shut). The app keeps the position and gives it back.

Signature

pub fn split_view<'a, M: Clone + 'a, L: Children<M> + 'a, R: Children<M> + 'a>( permille: u16, on_change: fn(u16) -> M, left: L, right: R, ) -> impl View<M> + 'a

Example

use fusuma::{split_view, text};
let view = split_view(300, |permille| permille, (text("List"),), (text("Detail"),));
let built = fusuma::doc::built::<u16, _>(&view);
assert_eq!(built.texts(), ["List", "Detail"]);

All components · Source