gsap-draggable

Implements drag, throw, rotation, and inertia interactions on DOM elements using GSAP Draggable.

52|3|Updated Aug 20, 2026
One-click install
npx skills add https://github.com/Wayn-Git/Amethyst --skill gsap-draggable-wayn-git
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gsap-draggable
Source: https://github.com/Wayn-Git/Amethyst/tree/main/agents/skills/gsap-draggable
Command: npx skills add https://github.com/Wayn-Git/Amethyst --skill gsap-draggable-wayn-git

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap.

What problem does it solve? Building drag-based UI from scratch requires handling pointer events, bounds math, velocity tracking, and touch support manually. This Skill provides ready-to-use GSAP Draggable and InertiaPlugin patterns so you can add drag, throw, rotation, and snapping interactions without reinventing the wheel. ## Core Features & Use Cases - Drag with Bounds: Constrain movement on x, y, or both axes to containers, rectangles, or relative ranges. - Inertia and Throwing: Add momentum-based throwing with resistance, duration limits, and edge resistance via InertiaPlugin. - Rotation and Snapping: Build dials and knobs with rotation bounds, liveSnap to grids, values, or custom functions. - Use Case: Build a sortable task list where users drag cards vertically within a board, snap them into place, and reorder the DOM on drag end. ## Quick Start Use the gsap-draggable skill to make the elements with class .box draggable within their container with inertia enabled.

Frequently Asked Questions about gsap-draggable

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make an element draggable with GSAP?▼

Register the Draggable plugin with gsap.registerPlugin(Draggable), then call Draggable.create('.box', { type: 'x,y', bounds: '.container' }). The type option controls the axis, and bounds constrains movement to a container or coordinate range.

How to add inertia or throwing to GSAP Draggable?▼

Register both Draggable and InertiaPlugin, then set inertia: true in the config. You can tune the throw with resistance, minDuration, maxDuration, and edgeResistance options to control how the element glides and stops.

Why is GSAP Draggable inertia not working?▼

Inertia fails when InertiaPlugin is not registered alongside Draggable. Call gsap.registerPlugin(Draggable, InertiaPlugin) before creating the instance, and confirm inertia: true is set in the configuration.

Why are Draggable bounds not constraining my element?▼

Bounds require the container to have CSS positioning, typically position: relative on the container and position: absolute on the dragged element. Without positioning, the bounds calculation has no reference frame and dragging appears unconstrained.

How do I snap dragged elements to a grid in GSAP?▼

Use the liveSnap option with a number for fixed intervals, an array of snap points, or a function returning the snapped value. For example, liveSnap: { x: 20, y: 20 } snaps movement to a 20-pixel grid during the drag.

Should I use x,y or left,top for GSAP drag type?▼

Use type: 'x,y' because it applies GPU-accelerated transforms and avoids layout thrashing. The left,top type modifies layout properties directly, which triggers reflows and performs worse, especially during continuous dragging.