Fusuma

Components / Composite

split_button

A button and, beside it, a second one that opens the other choices (a menu): the main action and its alternatives.

Try it

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

Live: Buttons, where split_button is usedOpen full size

Also on this pagechipbuttonicon

A button and, beside it, a second one that opens the other choices (a menu): the main action and its alternatives.

on_press is the main action, on_more opens the others (a menu hung from the second button).

Signature

pub fn split_button<'a, M: Clone + 'a>( label: &'a str, on_press: M, on_more: M, ) -> impl View<M> + 'a

Example

use fusuma::split_button;
let view = split_button("Save", 0, 1);
let built = fusuma::doc::built::<i32, _>(&view);
assert!(built.texts().contains(&"Save"));

All components · Source