roginfarrer / collapsed

Headless UI for for creating flexible and accessible expand/collapse components in TS/JS.
https://react-collapsed.netlify.app/
MIT License
511 stars 41 forks source link

Horizontal expand/collapse? #81

Open nielskrijger opened 2 years ago

nielskrijger commented 2 years ago

Thanks for the great library! I've been using it all over in one of my projects.

I was wondering, would it be complex to add a horizontal (width) based collapse effect?

I'm thinking of a sidebar expanding/collapsing.

If you're interested, I could have a look at creating a PR (if I find the time 😅 ); but before I do I'd love to hear if you'd even consider merging a feature like that and if you have any requirements/pointers regarding code.

Regards, Niels

roginfarrer commented 2 years ago

If it doesn't add too much complexity, you're welcome to take a shot at it! I haven't dug into animating width in a long time, but I think it could be as simple as swapping out height for width (when measuring and manipulating properties)

SaidMarar commented 1 year ago

Hey guys 😃 Check the PR above i added the horizontal mode, please do not hesitate if you have any suggestions. expand-collapse @nielskrijger @roginfarrer

codepath2019 commented 1 year ago

Hi 👋 I've noticed that the last activity on this PR was a few months ago, @roginfarrer and @SaidMarar, are there any plans to merge this change in? thanks!