Skip to content

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dioxus use_gesture

Crates.io version docs.rs docs CI status

Gesture interaction library for Dioxus.

Pairs great with dioxus-spring!

let element_ref = use_mounted();

let (value_ref, spring_ref) = use_spring_signal([0f32, 0f32]);
use_animated(element_ref, value_ref, |[x, y]| {
    format!("width: 200px; height: 200px; background: red; transform: translate({x}px, {y}px);")
});

use_drag(element_ref, move |state, x, y| match state {
    DragState::Move => spring_ref.set([x, y]),
    DragState::End => spring_ref.animate([0., 0.], Duration::from_millis(500)),
});

rsx!(div {
    onmounted: move |event| element_ref.onmounted(event)
})

About

No description, website, or topics provided.

Resources

Stars

10 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages