[!CAUTION] This library is under heavy development! It is not ready to use. Proceed at your own risk.
Dioxus Motion đ
A lightweight, cross-platform animation library for Dioxus, designed to bring smooth, flexible animations to your Rust web, desktop, and mobile applications.
⨠Features
- Cross-Platform Support: Works on web (WASM), desktop, and mobile
- Flexible Animation Configuration
- Custom Easing Functions
- Modular Feature Setup
- Simple, Intuitive API
đ Installation
Add to your Cargo.toml:
[]
= {
git = "https://github.com/wheregmis/dioxus-motion.git",
= "main",
= true
}
[]
= ["web"]
= ["dioxus/web", "dioxus-motion/wasm"]
= ["dioxus/desktop", "dioxus-motion/desktop"]
= ["dioxus/mobile", "dioxus-motion/desktop"]
đ Platform Support
Choose the right feature for your platform:
web: For web applications using WASMdesktop: For desktop and mobile applicationsdefault: Web support (if no feature specified)
đ Quick Start
Basic Animation
use *;
use ;
use Duration;
Transform Animation with Spring
use *;
use ;
Advanced Value Animation
use *;
use *;
Advanced Transform Animation
use *;
use ;
đ Configuration Options
đŽ Value Animation Methods
Core Methods
- đ¯
.to(value: f32)- Set target animation value - âąī¸
.duration(Duration)- Set animation duration - đ
.spring(Spring)- Configure spring physics - â¨
.on_complete(fn)- Add completion callback
Control Methods
- âļī¸
.start()- Start the animation - â¸ī¸
.stop()- Pause the animation - đ
.reset()- Reset to initial state - đ
.loop_animation()- Start continuous loop - âšī¸
.stop_loop()- Stop loop animation
đ¨ Transform Animation Methods
Properties
- đ
.x()- Get horizontal position - đ
.y()- Get vertical position - đ
.scale()- Get scale factor - đ
.rotate()- Get rotation angle - đģ
.opacity()- Get opacity value
Control Methods
- âļī¸
.start()- Start transform animation - â¸ī¸
.stop()- Stop transform animation - đ
.reset()- Reset to initial transform - âŽī¸
.reverse()- Reverse animation direction - đ
.loop_animation()- Start continuous loop - âšī¸
.stop_loop()- Stop loop animation - đ¨
.style()- Get current CSS transform string
đ Supported Easing Functions
Leverages the easer crate, supporting:
- Linear
- Quadratic
- Cubic
- Quartic
- And more!
đģ Example Project Configurations
Web Project
[]
= "0.4"
= {
git = "https://github.com/wheregmis/dioxus-motion.git",
= ["web"]
}
Desktop and Mobile Project
[]
= "0.6.1"
= {
git = "https://github.com/wheregmis/dioxus-motion.git",
= ["desktop"]
}
đ¤ Contributing
- Fork the repository
- Create your feature branch
- Commit changes
- Push to the branch
- Create a Pull Request
đ License
MIT License
đ Reporting Issues
Please report issues on the GitHub repository with:
- Detailed description
- Minimal reproducible example
- Platform and feature configuration used
đ Motivation
Bringing elegant, performant motion animations to Rust's web and desktop ecosystems with minimal complexity.