loading code fetching the highlighted snippet
A mobile bottom sheet you dismiss by dragging the handle down past a threshold. The gesture writes a bound y MotionValue, so the close animation continues from exactly where you let go — and it follows the light/dark theme.
dragListener={false} plus controls.start(e) on pointerdown means the sheet body stays
scrollable while the grip drives the gesture.drag="y" writes the bound style={{ y }} MotionValue, so onDragEnd can read y.get() for the close
threshold and animate(y, …) resumes from the dragged position.dragConstraints pins the rest position to the top, while dragElastic={{ bottom: 0.5 }} gives a soft downward pull
before it either closes or springs back.Tap to open the bottom sheet