Chargement de l'article...
gsap.from() works in the opposite direction. The element starts from a state you describe and moves toward its natural CSS state. It's the perfect tool for entrance animations — a title rising from below, cards appearing progressively as a page loads. One of the most powerful properties associated with this method is stagger: it automatically offsets the animation of each element in a list, creating an elegant cascade effect without a single line of manual calculation.
gsap.fromTo() gives you absolute control over both ends of the animation. You explicitly define the start state and the end state. This is the method to reach for when you want to leave nothing to the browser's interpretation and visual consistency is non-negotiable.
If the core methods are musicians, the Timeline is the orchestra. It's the tool that transforms GSAP from a simple animation library into a genuine visual storytelling engine.
A Timeline lets you chain animations in a precise order, overlap them exactly as you intend, and control the entire sequence as if it were a single entity. You can pause the whole scenario at once, speed it up, play it backwards, or scrub through it manually with a slider.
The detail that makes all the difference in a Timeline is offset control. You can tell GSAP to start an animation 0.4 seconds before the previous one ends, creating natural overlaps that give rhythm to your sequence. Without this precision, animations follow each other mechanically. With it, they breathe.
Timelines also emit events — you can trigger a JavaScript function precisely when an animation ends, when it begins, or on every rendered frame. That's the bridge between pure animation and your interface's application logic.
ScrollTrigger is the plugin that revolutionized how front-end developers build scroll experiences. It allows you to tie any animation to the user's scroll progress — and this is where truly memorable interfaces are built.
The concept is straightforward: you define a start point and an end point on the page, and GSAP maps your animation's state to the user's exact position within that range. If the user scrolls back up, the animation plays in reverse. If they scroll fast, the animation moves fast. The interface becomes a direct extension of the gesture.
One of the most-used features is scrubbing with inertia. Instead of the animation following the scroll pixel-for-pixel in a rigid way, you add a slight lag that creates the impression the element has weight, physical resistance. It's this kind of detail — imperceptible consciously yet felt immediately — that separates a professional site from a remarkable one.
The pinning technique is another powerful weapon. It locks a section on screen while the user continues scrolling, playing out a full animation before releasing the page flow. This is the exact mechanic behind Apple's product presentation pages — a section that appears frozen while content progressively reveals itself from within.
Animating a title as a single block is the lazy solution. The technique that genuinely impresses involves breaking that title down — letter by letter, word by word, line by line — and animating each fragment individually.
The effect is striking: characters rise from below as if emerging from an invisible curtain, with a tiny offset between each one. The result is clean, memorable, and immediately communicates a level of craft the user feels without being able to name it. GSAP offers the SplitText plugin precisely for this — it breaks your text into animatable units in a single operation, then lets you orchestrate their entrance however you see fit.
Icons that fluidly transform from one shape to another create a feeling of a "living" interface that users perceive immediately, even unconsciously. A hamburger menu dissolving into a close icon, a play button becoming a pause icon, a logo shifting state depending on navigation context.
GSAP's MorphSVG plugin makes these transformations trivial to implement. Two SVG shapes, a duration, an easing type — and the interface feels like it breathes on its own.
Parallax is one of the most overused techniques on the web, frequently executed poorly and visually aggressive. Done well with GSAP, it's the complete opposite — a subtle depth that gives the impression elements genuinely occupy different planes in space.
The key is restraint. Light displacements, different speeds per layer, and a soft scroll connection through scrubbing. The user doesn't think "parallax effect" — they think "this site has something different." That's exactly the goal.
Integrating GSAP into a modern server-rendered environment requires a few precautions that many developers discover too late into a project.
The golden rule: never let a GSAP animation "leak" after a component unmounts. GreenSock provides an official useGSAP hook that handles this cleanup automatically. It guarantees that all animations created within a component are properly destroyed when that component disappears, preventing memory leaks that degrade Single Page Application performance over time.
The second rule: always scope your animations to a reference container. This prevents generic CSS selectors from accidentally targeting elements outside the concerned component — a silent bug that's particularly hard to trace in large applications. With a well-defined scope, every component becomes an autonomous animation island.
Truly mastering GSAP also means taking responsibility toward users who are sensitive to motion. Some people experience dizziness or photosensitive epilepsy and have configured their system to reduce animations. Ignoring that preference isn't just an accessibility failure — it's a human one.
The best practice is simple: before triggering any animation sequence, check the prefers-reduced-motion system preference. If the user has requested less movement, display content directly in its final state without any transition. Nothing is lost — they get the information without the friction. One check, added consistently at the start of every project, and your interface becomes inclusive without any compromise for everyone else.
Mastering GSAP isn't simply about acquiring a new tool. It's about changing how you see the craft. It's understanding that every element's entrance on screen tells the user something — a hierarchy, an emotion, an invitation to go further.
In 2026, the interfaces that convert, retain attention, and build brand identity are the ones that were conceived in motion from the very start. GSAP gives you the language to express that vision with surgical precision.
The code you write can make someone feel something. That's rare. That's valuable. That's exactly what GSAP makes possible.