Use this component to add a title to a code block that’s styled differently from Starlight’s default styles. To use it, your docs page must be in .mdx format. Please change the format from .md to .mdx if necessary. All your existing markdown will still be supported without issue.
The component takes a title attribute. The title will be displayed as part of the code block in bold. Starlight’s default styles cause a title to appear either in a tab or in a mock terminal window. The Markdown syntax page has examples of all three styles.
Import the CodeBlock component like so:
Use the <CodeBlock> component within your content like so: