Function freya_components::GlobalAnimatedPosition

source ·
pub fn GlobalAnimatedPosition<T: Clone + PartialEq + Hash + Eq + 'static>(
    __props: GlobalAnimatedPositionProps<T>,
) -> Element
Expand description

Animate an element position across time and space.

For that, the element must have an unique ID.

It must also be descendant of a [GlobalAnimatedPositionProvider].

§Example

fn app() -> Element {
    rsx!(
        GlobalAnimatedPositionProvider::<i32> {
            GlobalAnimatedPosition {
                id: 0,
                width: "100",
                height: "25",
                label {
                    "Click this"
                }
            }
        }
    )
}

§Props

For details, see the props struct definition.