Repository navigation
feat: showcase scroll-into-view-transition as an alternative to smooth-scroll-into-view-if-needed - #1140
Open
stipsan wants to merge 1 commit into
Open
feat: showcase scroll-into-view-transition as an alternative to smooth-scroll-into-view-if-needed#1140stipsan wants to merge 1 commit into
stipsan wants to merge 1 commit into
Conversation
Installs scroll-into-view-transition from the git branch of scroll-into-view/scroll-into-view-transition#14 (bf3607d). The package only builds in prepublishOnly, which git installs don't run, so a pnpm patch adds its built dist/. Co-authored-by: Cody Olsen <stipsan@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
stipsan
marked this pull request as ready for review
November 19, 2026 14:49
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a "Smooth scrolling with View Transitions" section right after the existing "Scrolling if needed" demo. It presents
scroll-into-view-transitionas the alternative tosmooth-scroll-into-view-if-needed. The smooth-scroll demo and the hero are unchanged.View Transitions demo beside the smooth-scroll demo
What the demo shows
await scrollIntoView(node, { duration, easing, middleware }). With "If needed", the snippet addsonlyIfNeeded()fromscroll-into-view-transition/middleware.scroll-into-view-if-neededoptions, including middleware, and returns a Promise. CSS View Transitions run the animation. When View Transitions aren't supported, or the user prefers reduced motion, it scrolls instantly. In that case the demo shows a short "Scrolling instantly: …" note.Dependency: git branch plus a patch (please review)
The package isn't on npm. It's installed from the branch of scroll-into-view-transition#14, and the lockfile pins head
bf3607db5f9096c8e76aba18e535831d682528f8.On its own, that install ships no code. The package builds
dist/only inprepublishOnly, and pnpm only runspreparefor git dependencies.src/isn't in itsfileseither. To keep the install on the git branch,patches/scroll-into-view-transition@0.1.2.patchadds thedist/built frombf3607dwithvp pack. It's about 380 lines of unminified ESM and.d.mts, registered underpatchedDependencies.To remove the patch, the package needs either a
preparebuild script or an npm release. Once it has one, delete the patch and thepatchedDependenciesentry.Checks
These pass locally:
vp check,vp exec knip,vp run typecheck(0 errors),vp run build, andvp migratewith no diff.vp testfinds no test files, the same as onmain.I tested it in Chrome: the scrolling animates, the snippet changes with each option, no fallback note shows, and the existing smooth-scroll demo still works.
To show artifacts inline, enable in settings.