isosphere / yew-bootstrap

Bootstrap 5 Components for the Yew Framework
https://crates.io/crates/yew-bootstrap
MIT License
37 stars 18 forks source link

Add animation to Modal component? #25

Open danya02 opened 1 year ago

danya02 commented 1 year ago

Right now, the yew_bootstrap::component::Modal will appear and disappear without animation, while the JS Bootstrap component has an optional fade-and-slide effect. That effect will happen if the div.modal also has a .fade, and if this class is added to the HTML produced by component::Modal, it also works. Maybe there should be a property that allows using this behavior?

isosphere commented 1 year ago

I agree with your proposal; it sounds like it would be pretty easy to implement. A boolean property which would trigger adding the "fade" class to the set of classes added to the modal. If we aren't using the appendable classes pattern for this component, we certainly are elsewhere in the project.

If you make a PR for this I'll be happy to merge it!