Fusuma

Components / Layout

present

view while when is true; coming in from offset, and leaving to it, on a spring.

How it looks

Drawn by the toolkit from the example below. No page of the gallery uses present yet, so there is nothing to run.

present drawn by Fusuma

view while when is true; coming in from offset, and leaving to it, on a spring. Built the way it is at the start, shown or hidden, without a move.

Signature

pub const fn present<V>( when: bool, offset: (i32, i32), spring: fusuma_anim::SpringConfig, view: V, ) -> Presence<V>

Example

use fusuma::anim::SpringConfig;
use fusuma::{present, text};
let open = true;
let view = present(open, (0, 6), SpringConfig::SPATIAL, text("Sliding panel"));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Sliding panel"]);

All components · Source