Snap Points Overview
Snap points define heights or positions where a sheet can rest when dragged. Users can snap between these points by dragging or using velocity.- 40% of screen height
- 70% of screen height
- 100% of screen height (fullscreen)
Snap Point Values
Snap points can be specified as:| Format | Example | Meaning |
|---|---|---|
| Number (0–1) | 0.5 | 50% of screen height |
| ”auto” (NEW) | "auto" | Intrinsic content height |
| Pixel value | 300 | Absolute pixels (less common) |
Basic Snap Points
Fixed percentage-based snap points:Auto Snap Points (NEW in 3.4)
Use"auto" to size a snap point to the content’s intrinsic height:
Accessing Content Dimensions
In yourscreenStyleInterpolator, access the measured content height:
Sheet Scroll Gesture Behavior
Control how ScrollView gestures interact with snap points:Expand and Collapse (Default)
With"expand-and-collapse", users can expand the sheet by scrolling up when at the top:
- Scroll down anywhere: ScrollView scrolls
- At top (scrollY = 0), drag up: Sheet expands to next snap point
- Below last snap point: Sheet snaps back up
- Swipe down: Sheet collapses
Collapse Only
With"collapse-only", the sheet cannot expand via scroll. Users must drag from dead space:
- Scroll works anywhere: ScrollView has priority
- At top, drag up: No effect (use expand-and-collapse for this)
- Need to expand? Add a header or dead space above content
- Drag from header or outside ScrollView to expand
Multiple Snap Points
Create complex sheet behaviors with multiple snap points:Velocity-Based Snap Selection
When users release a gesture with velocity, the snap point selection considers momentum:Snap Locked Gestures
Force snapping to exact points—no intermediate resting positions:Programmatic Snap Control
Use the snap controller to programmatically move between snap points:Combining with Shared Elements
Snap points work well with shared element animations:Snap Point Edge Cases
Very Tall Content
If content is taller than screen, use"auto" with a second snap point:
Nested Snap Points
A sheet inside a sheet can have its own snap points:Performance Optimization
Avoid Too Many Snap Points
More snap points = more interpolation complexity:Use “auto” Wisely
Auto sizing requires layout measurement. For simple fixed heights, use numbers:Troubleshooting
Snap Points Not Working
Check:gestureEnabledis true- Interpolator uses snap point positions in the transform
- ScrollView scroll doesn’t prevent snapping (check
sheetScrollGestureBehavior)
Content Doesn’t Expand
If using"auto" and content height is 0:
Velocity Too Strong
Reduce velocity impact:Next Steps
- Learn custom animations for interpolator details
- Explore gestures for interaction control
- See ScrollViews for scroll coordination patterns
