Search code examples
markdownblockdocusaurus

Docosaurus: How can you hide Copy button next to the code example?


I want to do the opposite from https://gist.github.com/yangshun/55db997ed0f8f4e6527571fc3bee4675.

Can I somehow hide the Copy button from individual Code block (https://docusaurus.io/docs/markdown-features/code-blocks)?


Solution

  • Here is the answer that I've found on the Docosaurus support site.

    You can use CSS to hide the button. You just need to assign "your language" to the block where you want to hide the block button.

    ```buttonless
    

    You also need to add the following CSS code:

    .buttonless button {
    display: none;
    }