A heading that opens and closes what is under it: the heading is a button (filled while open), the body is kept and hidden when closed, so what is in it keeps its state. on_toggle is what pressing the heading sends; the app flips open.
Signature
pub fn accordion<'a, M: Clone + 'a, C: Children<M> + 'a>( title: &'a str, open: bool, on_toggle: M, body: C, ) -> impl View<M> + 'aExample
use fusuma::{accordion, text};
let view = accordion("Details", false, (), (text("Hidden until opened"),));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Details", "Hidden until opened"]);