Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Import useMemo and cache loopedPaths and indices to avoid recreating arrays on every render. Update the effect to depend on the memoized loopedPaths so animations update reliably when paths change.
Implement a step prop that switches the component to controlled mode and animates directly to the target step (preserving mid- animation state). Add a useSvgMorph hook to manage step state (setStep/next/prev/isFirst/isLast), include a controlled demo, and update docs and registry metadata to advertise the new mode and hook.
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.
Result
New
svg-morphregistry component that morphs SVG pathdattributes with auto-looping. Supports multiple morph slots (each cycling through its own path states), static paths for compound shapes, and atransformprop for coordinate system conversion.registry/joyco/blocks/svg-morph.tsx— uses flubber for path interpolation + Motion for animationInstall via:
Dependencies added automatically:
flubber,motion.Media
Screen.Recording.2026-02-12.at.11.24.49.PM.mov
Greptile Overview
Greptile Summary
Adds a new
svg-morphcomponent that smoothly animates between SVG path states using flubber interpolation and Motion animation. The implementation supports both auto-looping mode (cycles through states automatically) and controlled mode (programmatically jump to specific steps).AutoMorphPathandControlledMorphPathcomponentsuseSvgMorphhook provides intuitive step navigation with boundary checksflubber,motion) properly added to package.jsonConfidence Score: 5/5
Important Files Changed
Last reviewed commit: 3d93fba