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
Stop Spamming Reddit for MRR. It’s Killing Your Brand (You need Claude Code for BuildInPublic instead) User Avatar 182 comments What happened after my AI contract tool post got 70+ comments User Avatar 128 comments How to build a quick and dirty prototype to validate your idea User Avatar 53 comments Where is your revenue quietly disappearing? User Avatar 51 comments The Quiet Positioning Trick Small Products Use to Beat Bigger Ones User Avatar 40 comments I Thought AI Made Me Faster. My Metrics Disagreed. User Avatar 38 comments