Skip to content

Latest commit

 

History

History
84 lines (72 loc) · 1.67 KB

README.md

File metadata and controls

84 lines (72 loc) · 1.67 KB

GitHub Clones GitHub Clones


Example CodeBlock

  • Code
<Pre
  codeBlocks={[
    {
      language: 'javascript',
      content: `var greeting = "Hello, World!";
console.log(greeting);`,
    },
  ]}
/>
  • Dropdown CodeBlock
<Pre
  codeBlocks={[
    {
      label: 'JavaScript',
      language: 'javascript',
      content: `var greeting = "Hello, World!";
console.log(greeting);`,
    },
    {
      label: 'HTML',
      language: 'html',
      content: `<html>
    <body>
      <p>Hello, World!
      </p>
    </body>
</html>`,
    },
  ]}
/>
  • iFrame
<Pre
  codeBlocks={[
    {
      iframe: true,
      content: `<html>
    <body>
      <p>Hello, World!
      </p>
    </body>
</html>`,
    },
  ]}
/>

You still can use triple-backsticks but it will be rendered without CopyButton (Its Pre components).


Sponsor

License

MIT