Search code examples
reactjsstorybookpre

How to wrap soucecode in Storybook mdx file


In my Storybook docs I am trying to display source code in a div, primarily to show it in a grid. So I would like to do something like:

<div>
  ```tsx dark
  return 'source code here' ```
</div>

Is there anyway to accomplish this?


Solution

  • turns out all I needed to do was:

    <div>
    
      ```tsx dark
      return 'source code here' ```
    
    </div>