feat: improve copy code button with animated success state#630
Merged
Mayur-Pagote merged 2 commits intoJun 2, 2026
Conversation
- Add smooth state transitions to 'Copy Code' buttons using framer-motion - Switch button color and icon on success - Consolidate animation imports to use 'framer-motion'
|
@Adi-Marathe is attempting to deploy a commit to the mayur-pagote's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
@Adi-Marathe amazing work |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
|
@Adi-Marathe PR Build Check is failing, please fix it. |
Author
ok |
… add type annotations
Author
|
Hello @Mayur-Pagote Pleae check it out |
Owner
|
@Adi-Marathe thank you |
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.
Description
Currently, when a user clicks the Copy Code button on the README design cards or template preview, only a toast notification is shown. This PR introduces a smooth, direct visual feedback animation on the button itself to make the interface feel more intuitive, responsive, and modern.
Changes Made
isCopiedstate to theComponentCardandTemplatePreviewcomponents.<Check />).framer-motion(<AnimatePresence>).bg-green-500) to the button when clicked.motion/reactto useframer-motioninstead, fixing a dependency resolution issue and removing the unusedmotiondependency.Visual Proof
Please check the screen recording below to see the animated success states in action!
README-Design-Kit.mp4
Related Issue
Fixes #624
Checklist