How would I use GSAP with Elm


Hello, very noob question here: I’m at a point where I’m ready for something like Elm. Everything seems pretty solid but I have a question regarding animation libraries. GSAP/Greensock is very popular animation library and we’re looking at using it for some front-end projects. How (if possible) can GSAP be used with Elm? Is there some sort of wrapper to look for or is there a simply way to interface with JS land?

Does anyone know of idiomatic or recommended public repo that does this or perhaps demonstrates how a bridge between Elm and JS land occurs?

Thanks in advance!


GSAP is a great library, but there’s a fairly strong Elm cultural bent to not just wrapping existing JavaScript libraries, and not just because the elm community wants to be different. The type safety of Elm is dependent on any underlying JavaScript code being safely minimized, contained and extensively reviewed.

You can, however, interface with JavaScript libraries through ports (which you can learn about in the Elm tutorial I believe). There are also some good animation libraries written in pure elm that will give you both great type safety and idiomatic elm API’s.