Search

Back

Copy Link

Library

/

Free

/

47

Copy Link to Current Page

47

Copy Link to Current Page

Not loading? Preview

Made by

@frameroverrides

override

click

Override

Copy Link to Current Page

Copy

Override

Copied to Clipboard!

Instructions

This will copy the link to the page that the user is on when clicking.

Code Preview

import * as React from "react"
import { Override } from "framer"

export function CopyLinkOnClick(): Override {
    return {
        onClick: async () => {
            const link = window.location.href // Get the current URL
            try {
                await navigator.clipboard.writeText(link)
                console.log("Link copied to clipboard:", link)
            } catch (err) {
                console.error("Failed to copy link to clipboard:", err)
            }
        },
    }
}

Terms of Use for Free Assets

By accessing and using this Framer Override Library, you agree to the following terms:

All code snippets provided are available for your personal and professional use. This includes personal websites, client projects, and other website projects in Framer. You are strictly prohibited from sharing, redistributing, selling these code snippets, or creating derivative works for resale or distribution. Unauthorized sharing, distribution, or selling of these code snippets is a breach of these terms and may result in termination of your access to this library, along with potential legal action.