ComponentsCopy Page markdown

Copy Page markdown

A split button that copies the page as Markdown or opens it in ChatGPT, Claude, v0 and more.

Preview

Installation

  1. 1

    Run the following command

    npx shadcn@latest add https://localhostui.com/r/copy-page-markdown.json
    

Props

PropTypeDefaultDescription
markdownstring—Raw markdown source for the current page. Used as the clipboard content for the "Copy Page" button. Falls back to pageUrl if omitted.
pageUrlstringwindow.location.href on the client if omittedCanonical URL of the current page. Used to build the "View as markdown" (.md) link and the "Open in V0 / Claude / ChatGPT" deep links.
githubUrlstring—Source URL for this page's file on GitHub. When provided, an "Open in GitHub" item appears in the dropdown; when omitted, that item is not rendered at all.
extraItemsMenuItem[]—Additional dropdown items appended after the default set (View as markdown, V0, Claude, ChatGPT, GitHub). Each item needs id, label, icon, external, and onSelect. Ignored if items is provided.
itemsMenuItem[]—Full override for the dropdown item list. When provided, replaces all default items (and extraItems is ignored) — use this to reorder, remove, or fully customize the built-in options.