Skip to content

How do I add code blocks to my MDX files? #24682

Answered by jonniebigodes
IPWright83 asked this question in Help
Discussion options

You must be logged in to vote

@IPWright83, thanks for taking the time to reach out to us with your question. We appreciate it 🙏 ! And to give you some context, documentation and, in this case, syntax highlighting was something that got some improvements with the major release (e.g., 7.0) and continued to get more updates in follow-up releases (e.g., 7.1, etc). If there's no language specified using triple backticks Storybook treats it as text by default. If you specify one of the supported languages (i.e., Javascript, Markdown, CSS, HTML, Typescript, GraphQL) it will recognize it and style it accordingly. I've created a small reproduction here if you're interested and got it deployed here

Let us know if this was able …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@IPWright83
Comment options

@IPWright83
Comment options

@IPWright83
Comment options

Answer selected by IPWright83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants