Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: useTransition hook #11

Open
9 tasks
endigo9740 opened this issue Apr 25, 2024 · 2 comments
Open
9 tasks

Add: useTransition hook #11

endigo9740 opened this issue Apr 25, 2024 · 2 comments
Labels
feature request Request a new feature to add. help wanted Extra attention is needed
Milestone

Comments

@endigo9740
Copy link
Contributor

Reference

https://floating-ui.com/docs/useTransition

Description

Provides the ability to apply CSS transitions to a floating element, including correct handling of “placement-aware” transitions.

Style Props

  • duration
  • initial
  • close
  • open
  • common
  • Scale transforms

Status

  • Asymmetric transitions
  • Placement-aware transitions

Status Props

  • duration
@endigo9740 endigo9740 added the feature request Request a new feature to add. label Apr 25, 2024
@endigo9740 endigo9740 added this to the v1.0 milestone Apr 25, 2024
@Hugos68
Copy link
Collaborator

Hugos68 commented May 9, 2024

I'm curious what the reason is to create this hook instead of leveraging Svelte's built in transition directive? Is it because of placement-aware transitions?

@endigo9740
Copy link
Contributor Author

@Hugos68 I think there's two main benefits:

  1. It enables custom CSS class-based animations. Svelte transitions are cool, but they are a bit more complicated to setup and use.
  2. As you mention, they would not have access to placement-aware transitions. So if the popover flips position, this won't affect the Svelte transition which will likely animate the same (ex: slide down where it's supposed to slide up, etc)

@Hugos68 Hugos68 added the help wanted Extra attention is needed label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a new feature to add. help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants