StealThis .dev

Bottom-sheet Drag

Drag a bottom sheet with Pointer Events, snapping it open or closed with momentum.

Open in Lab
html css javascript react
Targets: TS JS HTML React

Code

Bottom-sheet Drag

Drag a bottom sheet with Pointer Events, snapping it open or closed with momentum.

Support notes

The examples use Pointer Events, capture, bounded transforms, and small snap thresholds. Production code should also wire keyboard alternatives and reduced-motion preferences.

Included demo

  • Vanilla HTML, CSS, and JavaScript with zero external dependencies.
  • React equivalent using the same interaction model.
  • A Lab route for trying the behavior in isolation.

Integration checklist

Keep state updates separate from presentation, preserve semantic labels, and add persistence or server callbacks at the boundary where your product needs them.