The arrival
A jump that teleports loses the reader: the page changes under them and nothing says where they went or how far. A glide keeps the thread, the content slides by and stops where the link promised.
The landing is what people feel. A curve that slows into the heading reads as arriving; one that stops dead reads as hitting a wall.
Picking a speed
Around 700ms suits a marketing page with tall sections. Docs with short hops feel better faster, 400 or so. Past a second the reader starts waiting for the page instead of reading it.
Pass a function instead of a number and the time can grow with the distance, so a short hop stays short and a long one still glides.
Clearing the header
The glide stops at the heading's scroll-margin-top, the same value the browser uses for a plain jump, so a sticky header never covers the title. Set it once on your headings and every anchor agrees.
Need more room on one page only? The offset prop adds pixels on top of the margin.
Reduced motion
When the reader asks the system for less motion, links jump straight to the section. The hash, the back button and the focus still move exactly as they would with the glide.
A wheel turn, a tap or a key press during the glide hands the page back at once.