Skip to content

Detents

type DetentSpec = 'full' | 'medium' | 'content' | number | `${number}px`;
<Sheet.Root
detents={[0.35, 0.7, 'full']}
activeDetent={active}
onActiveDetentChange={setActive}
/>

A detent is a resting height, resolved to a scroll-snap stop. 'content' measures natural height, 'medium' is 50% of viewport, and 'full' is viewport minus a top inset. Any other number is a fraction, or pixels above 1.

List detents shortest first. The sheet sorts them by height for snapping, but Sheet.Handle’s click cycle, arrow keys, and slider value follow the order of your array. Detents that resolve to the same height collapse into one, and a spec that resolves to 0 or less is dropped.

onTravel(px, progress, info) fires every frame the sheet moves. Progress is also available as --scrollsheet-progress. The third argument contains range ([0, maxDetent], px) and progressAtDetents, a Map from each detent’s resolved pixel height to its own 0–1 progress. Use it to animate against a specific detent.

The info object is reused and updated each frame. Read it synchronously; do not keep the reference.

Drag it to any height and let go. It snaps to whichever of the three stops is nearest.