Giter Site home page Giter Site logo

dioxus-spring's Introduction

Dioxus Spring

Crates.io version docs.rs docs CI status

Animation library for Dioxus.

Pairs great with dioxus-use-gesture!

let is_big = use_state(cx, || false);
let spring = use_spring(
    cx,
    if **is_big { 2f32 } else { 1f32 },
    Duration::from_millis(500),
);

let mounted = use_mounted(cx);
use_animated(cx, mounted, spring, |scale| {
    format!("transform-origin: top left; transform: scale({scale})")
});

render!(
    div {
        onmounted: move |event| mounted.onmounted(event),
        onclick: move |_| is_big.set(!is_big),
        "Click me!"
    }
)

dioxus-spring's People

Contributors

matthunz avatar

Stargazers

David James avatar Qichao Lan avatar  avatar wackazong avatar opensourcegeek avatar Joseph avatar Tom Potter avatar Brandon Pollack avatar  avatar  avatar Stuart Gilliland  avatar Andrejs Agejevs avatar Dustin Blackman avatar Marc Espin avatar Evan Almloff avatar

Watchers

 avatar  avatar

Forkers

oyelowo

dioxus-spring's Issues

Animation frames not triggering component renders

In the upgrade to Dioxus 0.5, something broke with component re-renders. During the switch, use_state was blindly changed to use_signal so a deeper look into the new state updates should bring out the cause.

Add methods for streams

Animations should be able to be set to streams of values. This lets resizes trigger animation target values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.