1
1 Comment

Copy to clipboard button in MDX with Next.js and Rehype Pretty Code

This tutorial will guide you on how to create a 'copy to clipboard' button for the code snippets processed with Rehype Pretty Code plugin for syntax highlighting in Next.js. We'll be using Next.js 13+ with the 'app' directory enabled.

submitted this link to Icon for group Developers
Developers
on March 18, 2023
  1. 1

    Thank you for this detailed tutorial. Since 9 days the Rehype Pretty Code plugin comes with an inhouse copy-to-clipboard solution. It is available on npm under the package name "@rehype-pretty/transformers".

Trending on Indie Hackers
I sent 43 cold emails with my own tool. 17 replied. 1 paid. Here’s the unofficial launch. User Avatar 219 comments I built a web-based vector editor from scratch and integrated an AI Agent. Need just ONE beta tester! User Avatar 62 comments Why Your Users are Leaving in Silence (and How to Fix the "Leaky Bucket" with AI) User Avatar 21 comments Launched 580 landing pages in 1 week. Solo. No team. User Avatar 15 comments I spent 2.5 years building a marketing engine nobody can see without installing it. So I built a free distortion calculator. User Avatar 9 comments What Building a Local Dumpster Rental Business Taught Me About Customer Intent User Avatar 7 comments