--- url: /reference/items/Gsap/examples.md --- # Examples ## Playback and events The `targets` selector resolves inside the component, so the tween animates the three bars with a `stagger`. Each button calls one playback method, and an ancestor `Action` shows the last `gsap-*` event. :::code-group ```js import { registerComponents } from '@studiometa/js-toolkit'; import { Action } from '@studiometa/ui'; import { Gsap } from '@studiometa/ui-gsap'; registerComponents(Action, Gsap); ``` ::: ## Scroll-scrubbed tween The `scrollTrigger` option creates a [ScrollTrigger](https://gsap.com/docs/v3/Plugins/ScrollTrigger/) with the component root as trigger. With `scrub`, the scroll position drives the progress of the tween. :::code-group ```js import { registerComponents } from '@studiometa/js-toolkit'; import { Gsap } from '@studiometa/ui-gsap'; registerComponents(Gsap); ``` :::