dioxus-transition
π¬ Seamless transitions in Dioxus, inspired by Vueβs
<Transition>β declarative, built-in, composable.
This crate provides a fully reactive <Transition> component for Dioxus, allowing you to animate elements when they enter or leave the DOM β with full SSR/Web support and no JS shenanigans.
π€ Features
β
<Transition> component for conditional DOM animations
β
Vue-style logic with signal-reactive updates
β
Built-in transitions: fade, blur β easy to extend
β
Opt-out of built-ins via default-features = false
β
Works out-of-the-box with Dioxus Web
β
Built for flexibility: own styles, custom lifecycles, fine-grained control
π¦ Installation
Add it to your Cargo.toml:
[]
= "0.1"
# Optional: disable built-in transitions and use your own
= false
β‘ Example
use *;
use *;
π§ How It Works
The <Transition> component:
-
Tracks whether its children are present or placeholder
-
On entrance: injects
*-transition-hidden, then animates in with*-transition-activating -
On exit: runs reverse animation and cleans up
-
You control:
id: DOM node to animatekind: animation class prefix (e.g.fade)duration: in msignore_first: skip entrance animation on first mount (default: false)
π¨ Built-In Styles (enabled by default)
/* fade */
}
}
/* blur */
}
}
Donβt like them? Set default-features = false and roll your own π§
π§© Custom Transitions
Use any CSS class name as kind. All that matters is you provide these two classes:
.yourkind-transition-hiddenβ initial state.yourkind-transition-activatingβ active state
π Repo & Contributions
π¦ Crate: crates.io/crates/dioxus-transition π οΈ Repo: github.com/dsplce-co/dioxus-transition
Contributions, issues, ideas? Hit us up β let's make transitions in Dioxus delightful. π€
π License
MIT or Apache-2.0, at your option.